agora inbox for [email protected]  
help / color / mirror / Atom feed
TCL/TK configuration clean-up patches
966+ messages / 4 participants
[nested] [flat]

* TCL/TK configuration clean-up patches
@ 1998-10-15 08:02 Billy G. Allie <[email protected]>
  1998-10-15 14:48 ` Re: [PATCHES] TCL/TK configuration clean-up patches Brook Milligan <[email protected]>
  1998-10-15 15:58 ` Re: TCL/TK configuration clean-up patches Bruce Momjian <[email protected]>
  0 siblings, 2 replies; 966+ messages in thread

From: Billy G. Allie @ 1998-10-15 08:02 UTC (permalink / raw)
  To: [email protected]; +Cc: [email protected]; Bruce Momjian <[email protected]>

The attached patches clean-up the TCL/TK configuration as follows:

1.  Removed unnecessary code relating to TCL/TK configuration from configure.

2.  Change TCL/TK enabling to be dependant on the existance of an executable
    tclsh (locatable via $PATH) and the existance of tclConfig.sh and
    tkConfig.sh.

3.  The directories that are searched for the *Config.sh file is determined by
    the contents of $LIBRARY_DIRS (set by '--with-libs' or '--with-libraries')
    and the output generated by executing 'echo "puts $auto_path" | tchsh". 
    [Thanks Roland!]

    Note: If TK is installed in a different location the TCL, you must use the
          --with-libs (or --with-libraries) option of configure to specify it's
          location.

4.  Added "USE_TK" to Makefile.global which is set if TK support is available
    (as determined by the existance of tkConfig.sh).  USE_TK will only be set
    true if USE_TCL is true, and TK support is available.  This will allow
    features/programs that only depend on TCL to compile and install even if
    TK support is missing.

5.  Modified the pgtclsh Makefile so that pgtclsh will compile and install even
    if TK support is missing.  pgtksh will not be built unless TK support is
    available.

NOTE: The file, bin/pgtclsh/mkMakefile.tcltkdefs.sh.in, is no longer needed and
      can be removed.

NOTE: With these changes (and earlier ones), manually setting USE_TCL and 
      USE_TK in Makefile.global becomes a very bad idea and will cause the
      build to fail.


____       | Billy G. Allie    | Domain....: [email protected]
|  /|      | 7436 Hartwell     | Compuserve: 76337,2061
|-/-|----- | Dearborn, MI 48126| MSN.......: [email protected]
|/  |LLIE  | (313) 582-1540    | 


Attachments:

  [application/x-patch] uw7-3.patch (9.6K, ../../[email protected]/2-uw7-3.patch)
  download | inline diff:
*** src/bin/pgtclsh/Makefile.orig	Thu Oct 15 02:51:00 1998
--- src/bin/pgtclsh/Makefile	Thu Oct 15 03:30:16 1998
***************
*** 17,23 ****
  #
  # Include definitions from the tclConfig.sh file
  #
! include Makefile.tcltkdefs
  
  CFLAGS+= $(X_CFLAGS) -I$(SRCDIR)/interfaces/libpgtcl 
  
--- 17,26 ----
  #
  # Include definitions from the tclConfig.sh file
  #
! include Makefile.tcldefs
! ifeq ($(USE_TK), true)
! 	include Makefile.tkdefs
! endif
  
  CFLAGS+= $(X_CFLAGS) -I$(SRCDIR)/interfaces/libpgtcl 
  
***************
*** 30,40 ****
  LIBPGTCL= -L$(SRCDIR)/interfaces/libpgtcl -lpgtcl
  LIBPQ= -L$(LIBPQDIR) -lpq
  
! all: pgtclsh pgtksh
  
! Makefile.tcltkdefs:
! 	/bin/sh mkMakefile.tcltkdefs.sh
  
  pgtclsh: pgtclAppInit.o
  	$(CC) $(CFLAGS) $(TCL_DEFS) -o $@ pgtclAppInit.o \
  	  $(LIBPGTCL) $(LIBPQ) $(TCL_LIB_SPEC) $(TCL_LIBS) $(LDFLAGS)
--- 33,56 ----
  LIBPGTCL= -L$(SRCDIR)/interfaces/libpgtcl -lpgtcl
  LIBPQ= -L$(LIBPQDIR) -lpq
  
! # If we are here then TCL is available
! PGMS = pgtclsh
! INSTPGMS = install_tcl
  
! # Add TK targets if TK is available
! ifeq ($(USE_TK), true)
! 	PGMS += pgtksh
! 	INSTPGMS += install_tk
! endif
  
+ all: $(PGMS)
+ 
+ Makefile.tcldefs:
+ 	/bin/sh mkMakefile.tcldefs.sh
+ 
+ Makefile.tkdefs:
+ 	/bin/sh mkMakefile.tkdefs.sh
+ 
  pgtclsh: pgtclAppInit.o
  	$(CC) $(CFLAGS) $(TCL_DEFS) -o $@ pgtclAppInit.o \
  	  $(LIBPGTCL) $(LIBPQ) $(TCL_LIB_SPEC) $(TCL_LIBS) $(LDFLAGS)
***************
*** 44,51 ****
  	  $(LIBPGTCL) $(LIBPQ) $(X_LIBS) $(TK_LIB_SPEC) $(TK_LIBS) \
  	  $(TCL_LIB_SPEC) $(X11_LIBS) $(LDFLAGS)
  
! install: pgtclsh pgtksh
  	$(INSTALL) $(INSTL_EXE_OPTS) pgtclsh $(BINDIR)/pgtclsh
  	$(INSTALL) $(INSTL_EXE_OPTS) pgtksh $(BINDIR)/pgtksh
  
  clean:
--- 60,71 ----
  	  $(LIBPGTCL) $(LIBPQ) $(X_LIBS) $(TK_LIB_SPEC) $(TK_LIBS) \
  	  $(TCL_LIB_SPEC) $(X11_LIBS) $(LDFLAGS)
  
! install: $(INSTPGMS)
! 
! install_tcl: pgtclsh
  	$(INSTALL) $(INSTL_EXE_OPTS) pgtclsh $(BINDIR)/pgtclsh
+ 
+ install_tk: pgtksh
  	$(INSTALL) $(INSTL_EXE_OPTS) pgtksh $(BINDIR)/pgtksh
  
  clean:
*** src/bin/pgtclsh/mkMakefile.tkdefs.sh.in.orig	Thu Oct 15 02:51:00 1998
--- src/bin/pgtclsh/mkMakefile.tkdefs.sh.in	Thu Oct 15 03:43:17 1998
***************
*** 0 ****
--- 1,18 ----
+ 
+ if [ ! -f @TK_CONFIG_SH@ ]; then
+     echo "@TK_CONFIG_SH@ not found"
+     echo "I need this file! Please make a symbolic link to this file"
+     echo "and start make again."
+     exit 1
+ fi
+ 
+ . @TK_CONFIG_SH@
+ 
+ cat @TK_CONFIG_SH@ |
+     egrep '^TK_' |
+     while read inp
+     do
+ 	    eval eval echo $inp
+     done >Makefile.tkdefs
+ 
+ exit 0
*** src/bin/pgtclsh/mkMakefile.tcldefs.sh.in.orig	Thu Oct 15 02:51:00 1998
--- src/bin/pgtclsh/mkMakefile.tcldefs.sh.in	Thu Oct 15 02:51:27 1998
***************
*** 0 ****
--- 1,16 ----
+ 
+ if [ ! -f @TCL_CONFIG_SH@ ]; then
+     echo "@TCL_CONFIG_SH@ not found"
+     echo "I need this file! Please make a symbolic link to this file"
+     echo "and start make again."
+     exit 1
+ fi
+ 
+ cat @TCL_CONFIG_SH@ |
+     egrep '^TCL_' |
+     while read inp
+     do
+ 	    eval eval echo $inp
+     done >Makefile.tcldefs
+ 
+ exit 0
*** src/configure.in.orig	Thu Oct 15 02:51:00 1998
--- src/configure.in	Thu Oct 15 03:25:51 1998
***************
*** 222,256 ****
     [  --with-tcl              use tcl ],
     [
  	case "$withval" in
! 	y | ye | yes)		USE_TCL=true; AC_MSG_RESULT(enabled) ;;
! 	*)			USE_TCL=false; AC_MSG_RESULT(disabled) ;;
  	esac
     ],
!    [ USE_TCL=false; AC_MSG_RESULT(disabled) ]
  )
  
- dnl Add tcl/tk candidate directories to CPPFLAGS
- if test "$USE_TCL"; then
- 	header_dirs="/usr/include $INCLUDE_DIRS"
- 	tcl_dirs="tcl8.0 tcl80 tcl7.6 tcl76"
- 	tk_dirs="tk8.0 tk4.2"
- 	for dir in $header_dirs; do
- 		for tcl_dir in $tcl_dirs; do
- 			if test -d "$dir/$tcl_dir"; then
- 				PGSQL_CPPFLAGS="$PGSQL_CPPFLAGS -I$dir/$tcl_dir"
- 			fi
- 		done
- 	done
- 	for dir in $header_dirs; do
- 		for tk_dir in $tk_dirs; do
- 			if test -d "$dir/$tk_dir"; then
- 			PGSQL_CPPFLAGS="$PGSQL_CPPFLAGS -I$dir/$tk_dir"
- 			fi
- 		done
- 	done
- fi
  export USE_TCL
! USE_X=$USE_TCL
  
  dnl We exclude perl support unless we override it with --with-perl
  AC_MSG_CHECKING(setting USE_PERL)
--- 222,236 ----
     [  --with-tcl              use tcl ],
     [
  	case "$withval" in
! 	y | ye | yes)		USE_TCL=true; USE_TK=true; AC_MSG_RESULT(enabled) ;;
! 	*)			USE_TCL=; USE_TK=; AC_MSG_RESULT(disabled) ;;
  	esac
     ],
!    [ USE_TCL=; USE_TK=; AC_MSG_RESULT(disabled) ]
  )
  
  export USE_TCL
! export USE_TK
  
  dnl We exclude perl support unless we override it with --with-perl
  AC_MSG_CHECKING(setting USE_PERL)
***************
*** 266,274 ****
     [ USE_PERL=false; AC_MSG_RESULT(disabled) ]
  )
  
! #dnl Verify that postgres is already installed
! #dnl per instructions for perl interface installation
! if test "$USE_PERL" = "true"
  then
  	if test "$WHOAMI" != "root"
  	then	AC_MSG_WARN(perl support disabled; must be root to install)
--- 246,254 ----
     [ USE_PERL=false; AC_MSG_RESULT(disabled) ]
  )
  
! dnl Verify that postgres is already installed
! dnl per instructions for perl interface installation
! if test "$USE_PERL" = true
  then
  	if test "$WHOAMI" != "root"
  	then	AC_MSG_WARN(perl support disabled; must be root to install)
***************
*** 411,416 ****
--- 391,397 ----
  AC_SUBST(DLSUFFIX)
  AC_SUBST(DL_LIB)
  AC_SUBST(USE_TCL)
+ AC_SUBST(USE_TK)
  AC_SUBST(USE_PERL)
  AC_SUBST(USE_ODBC)
  AC_SUBST(MULTIBYTE)
***************
*** 782,787 ****
--- 763,829 ----
  	      AC_CHECK_LIB(m, rint, AC_DEFINE(HAVE_RINT), , $SPECIALMATHLIB)
  ])
  
+ dnl Check for Tcl configuration script tclConfig.sh
+ 
+ AC_PATH_PROG(TCLSH, tclsh)
+ 
+ if test -z "$TCLSH"
+ then
+ 	AC_MSG_WARN(TCL/TK support disabled; tclsh is not in your path)
+ 	USE_TCL=
+ fi
+ 	
+ if test "$USE_TCL" = true
+ then
+ 	AC_MSG_CHECKING(for tclConfig.sh)
+ 	TCL_CONFIG_SH=
+ 	library_dirs=`echo 'puts $auto_path' | $TCLSH`
+ 	library_dirs="$LIBRARY_DIRS $library_dirs"
+ 	for dir in $library_dirs; do
+ 		if test -d "$dir" -a -r "$dir/tclConfig.sh"; then
+ 			TCL_CONFIG_SH=$dir/tclConfig.sh
+ 			break
+ 		fi
+ 	done
+ 	if test -z "$TCL_CONFIG_SH"; then
+ 		AC_MSG_RESULT(no)
+ 		AC_MSG_WARN(TCL/TK support disabled; Tcl configuration script missing)
+ 		USE_TCL=
+ 	else
+ 		AC_MSG_RESULT($TCL_CONFIG_SH)
+ 		AC_SUBST(TCL_CONFIG_SH)
+ 	fi
+ fi
+ 
+ USE_TK=$USE_TCL		# If TCL is disabled, disable TK
+ 
+ dnl Check for Tk configuration script tkConfig.sh
+ if test "$USE_TK" = true
+ then
+ 	AC_MSG_CHECKING(for tkConfig.sh)
+ 	TK_CONFIG_SH=
+ 	# library_dirs are set in the check for TCL
+ 	for dir in $library_dirs
+ 	do
+ 		if test -d "$dir" -a -r "$dir/tkConfig.sh"
+ 		then
+ 			TK_CONFIG_SH=$dir/tkConfig.sh
+ 			break
+ 		fi
+ 	done
+ 	if test -z "$TK_CONFIG_SH"
+ 	then
+ 		AC_MSG_RESULT(no)
+ 		AC_MSG_WARN(TK support disabled; Tk configuration script missing)
+ 		USE_TK=
+ 	else
+ 		AC_MSG_RESULT($TK_CONFIG_SH)
+ 		AC_SUBST(TK_CONFIG_SH)
+ 	fi
+ fi
+ 
+ USE_X=$USE_TK
+ 
  dnl Check for X libraries
  
  if test "$USE_X" = true; then
***************
*** 819,882 ****
  	LDFLAGS="$ice_save_LDFLAGS"
  fi
  
- dnl Check for Tcl configuration script tclConfig.sh
- if test "$USE_TCL"; then
- 	AC_MSG_CHECKING(for tclConfig.sh)
- 	library_dirs="$LIBRARY_DIRS /usr/lib"
- 	TCL_CONFIG_SH=
- 	for dir in $library_dirs; do
- 		for tcl_dir in $tcl_dirs; do
- 			if test -z "$TCL_CONFIG_SH"; then
- 				if test -d "$dir/$tcl_dir" -a -r "$dir/$tcl_dir/tclConfig.sh"; then
- 					TCL_CONFIG_SH=$dir/$tcl_dir/tclConfig.sh
- 				fi
- 			fi
- 		done
- 		if test -z "$TCL_CONFIG_SH"; then
- 			if test -d "$dir" -a -r "$dir/tclConfig.sh"; then
- 				TCL_CONFIG_SH=$dir/tclConfig.sh
- 			fi
- 		fi
- 	done
- 	if test -z "$TCL_CONFIG_SH"; then
- 		AC_MSG_RESULT(no)
- 		AC_MSG_WARN(tcl support disabled; Tcl configuration script missing)
- 		USE_TCL=
- 	else
- 		AC_MSG_RESULT($TCL_CONFIG_SH)
- 		AC_SUBST(TCL_CONFIG_SH)
- 	fi
- fi
- 
- dnl Check for Tk configuration script tkConfig.sh
- if test "$USE_TCL"; then
- 	AC_MSG_CHECKING(for tkConfig.sh)
- 	library_dirs="$LIBRARY_DIRS /usr/lib"
- 	TK_CONFIG_SH=
- 	for dir in $library_dirs; do
- 		for tk_dir in $tk_dirs; do
- 			if test -z "$TK_CONFIG_SH"; then
- 				if test -d "$dir/$tk_dir" -a -r "$dir/$tk_dir/tkConfig.sh"; then
- 					TK_CONFIG_SH=$dir/$tk_dir/tkConfig.sh
- 				fi
- 			fi
- 		done
- 		if test -z "$TK_CONFIG_SH"; then
- 			if test -d "$dir" -a -r "$dir/tkConfig.sh"; then
- 				TK_CONFIG_SH=$dir/tkConfig.sh
- 			fi
- 		fi
- 	done
- 	if test -z "$TK_CONFIG_SH"; then
- 		AC_MSG_RESULT(no)
- 		AC_MSG_WARN(tcl support disabled; Tk configuration script missing)
- 		USE_TCL=
- 	else
- 		AC_MSG_RESULT($TK_CONFIG_SH)
- 		AC_SUBST(TK_CONFIG_SH)
- 	fi
- fi
- 
  dnl cause configure to recurse into subdirectories with their own configure
  dnl Darn, setting AC_CONFIG_SUBDIRS sets a list $subdirs$ in the configure output
  dnl  file, but then configure doesn't bother using that list. Probably a bug in
--- 861,866 ----
***************
*** 909,915 ****
  	bin/pg_dump/Makefile
  	bin/pg_version/Makefile
  	bin/psql/Makefile
! 	bin/pgtclsh/mkMakefile.tcltkdefs.sh
  	include/version.h
  	interfaces/libpq/Makefile
  	interfaces/ecpg/lib/Makefile
--- 893,900 ----
  	bin/pg_dump/Makefile
  	bin/pg_version/Makefile
  	bin/psql/Makefile
! 	bin/pgtclsh/mkMakefile.tcldefs.sh
! 	bin/pgtclsh/mkMakefile.tkdefs.sh
  	include/version.h
  	interfaces/libpq/Makefile
  	interfaces/ecpg/lib/Makefile
*** src/Makefile.global.in.orig	Thu Oct 15 02:51:00 1998
--- src/Makefile.global.in	Thu Oct 15 03:33:52 1998
***************
*** 136,142 ****
--- 136,146 ----
     endif
  endif
  
+ #
+ # Please do not edit USE_TCL and USE_TK by hand.
+ #
  USE_TCL= @USE_TCL@
+ USE_TK= @USE_TK@
  
  USE_PERL= @USE_PERL@
  


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

* Re: [PATCHES] TCL/TK configuration clean-up patches
  1998-10-15 08:02 TCL/TK configuration clean-up patches Billy G. Allie <[email protected]>
@ 1998-10-15 14:48 ` Brook Milligan <[email protected]>
  1 sibling, 0 replies; 966+ messages in thread

From: Brook Milligan @ 1998-10-15 14:48 UTC (permalink / raw)
  To: [email protected]; +Cc: [email protected]; [email protected]; [email protected]

   1.  Removed unnecessary code relating to TCL/TK configuration from configure.

Generally a good idea, but what is unnecessary depends on perspective.
See below.

   2.  Change TCL/TK enabling to be dependant on the existance of an executable
       tclsh (locatable via $PATH) and the existance of tclConfig.sh and
       tkConfig.sh.

What if the executable is not named tclsh?  This is not just idle
speculation, because of the incompatibilities between different tcl
versions.  There is real reason to maintain multiple versions if tcl
applications require the features of one version that are not in
another.  In such cases it is natural to name the executable tclsh7.6
or tclsh8.0 or some such thing in order to distinguish them.  

This really is the same problem as looking for the include/library
directories only now you are looking for (perhaps) versioned
executables.

It seems to me that the following might be a better solution:

   - new configure argument to set TCL variable
     --with-tcl=tclsh8.0		[ with default = tclsh ]

   - USE_TCL disabled if the named tcl is not found

   - TclConfig.sh found via 'echo "puts $auto_path" | ${TCL}'

   - use TclConfig.sh to generate Makefile.tcl

This would give full flexibility to specify the tcl executable while
maintaining a useful default.  Is there any need to search the whole
library list for TclConfig.sh?

   3.  The directories that are searched for the *Config.sh file is determined by
       the contents of $LIBRARY_DIRS (set by '--with-libs' or '--with-libraries')
       and the output generated by executing 'echo "puts $auto_path" | tchsh". 
       [Thanks Roland!]

See above.

       Note: If TK is installed in a different location the TCL, you must use the
	     --with-libs (or --with-libraries) option of configure to specify it's
	     location.

Would it make sense to have a --with-tk-lib=/usr/xxx/tk configure
option?  I suggest this because the only purpose is to find the
tkConfig.sh during configuration, not to influence all linking.
Similarly, it might make sense to have --with-tcl-lib=/usr/xxx/tcl to
override the mechanism mentioned above that relies on the tcl
executable.

These ideas would lead to the following configure arguments:

      --with-tcl=...   specifies tcl excutable name (or path); used to
        find tcl libs which are searched for tclConfig.sh

      --with-tcl-lib=...    specifies a list of tcl lib directories;
        used to find tclConfig.sh if tcl executable unavailable

      --with-tk-lib=...     specifies a list of tk lib directories;
        used to find tkConfig.sh

With suitable defaults for these, the behavior you are proposing could
easily be obtained, while still maintaining rather general
configuration capability.

   4.  Added "USE_TK" to Makefile.global which is set if TK support is available
       (as determined by the existance of tkConfig.sh).  USE_TK will only be set
       true if USE_TCL is true, and TK support is available.  This will allow
       features/programs that only depend on TCL to compile and install even if
       TK support is missing.

Good.

   5.  Modified the pgtclsh Makefile so that pgtclsh will compile and install even
       if TK support is missing.  pgtksh will not be built unless TK support is
       available.

Good.

Be sure to modify the INSTALL document to reflect the arguments to
configure.

Cheers,
Brook



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

* Re: TCL/TK configuration clean-up patches
  1998-10-15 08:02 TCL/TK configuration clean-up patches Billy G. Allie <[email protected]>
@ 1998-10-15 15:58 ` Bruce Momjian <[email protected]>
  1 sibling, 0 replies; 966+ messages in thread

From: Bruce Momjian @ 1998-10-15 15:58 UTC (permalink / raw)
  To: [email protected]; +Cc: [email protected]; [email protected]

Applied.

> The attached patches clean-up the TCL/TK configuration as follows:
> 
> 1.  Removed unnecessary code relating to TCL/TK configuration from configure.
> 
> 2.  Change TCL/TK enabling to be dependant on the existance of an executable
>     tclsh (locatable via $PATH) and the existance of tclConfig.sh and
>     tkConfig.sh.
> 
> 3.  The directories that are searched for the *Config.sh file is determined by
>     the contents of $LIBRARY_DIRS (set by '--with-libs' or '--with-libraries')
>     and the output generated by executing 'echo "puts $auto_path" | tchsh". 
>     [Thanks Roland!]
> 
>     Note: If TK is installed in a different location the TCL, you must use the
>           --with-libs (or --with-libraries) option of configure to specify it's
>           location.
> 
> 4.  Added "USE_TK" to Makefile.global which is set if TK support is available
>     (as determined by the existance of tkConfig.sh).  USE_TK will only be set
>     true if USE_TCL is true, and TK support is available.  This will allow
>     features/programs that only depend on TCL to compile and install even if
>     TK support is missing.
> 
> 5.  Modified the pgtclsh Makefile so that pgtclsh will compile and install even
>     if TK support is missing.  pgtksh will not be built unless TK support is
>     available.
> 
> NOTE: The file, bin/pgtclsh/mkMakefile.tcltkdefs.sh.in, is no longer needed and
>       can be removed.
> 
> NOTE: With these changes (and earlier ones), manually setting USE_TCL and 
>       USE_TK in Makefile.global becomes a very bad idea and will cause the
>       build to fail.


-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  [email protected]            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 966+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 966+ messages in thread


end of thread, other threads:[~2026-03-23 20:37 UTC | newest]

Thread overview: 966+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-10-15 08:02 TCL/TK configuration clean-up patches Billy G. Allie <[email protected]>
1998-10-15 14:48 ` Brook Milligan <[email protected]>
1998-10-15 15:58 ` Bruce Momjian <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro 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