pgsql: Disallow direct use of the pgrepack logical decoding plugin

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Disallow direct use of the pgrepack logical decoding plugin
Date: 2026-06-09 18:16:16
Message-ID: E1wX0zo-001let-1I@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Disallow direct use of the pgrepack logical decoding plugin

Nothing is to be gained from using pgrepack outside of REPACK
(CONCURRENTLY), and it leads to assertion failures in assertion-enabled
builds, and to crashes due to bogus memory lifetime in production
builds. Reject attempts to do that with a clean error report.

Clean up the nearby code a tad while at it. The only functional changes
in that are that the output_writer_private context is allocated and
partially filled by the pgrepack output plugin; and that ->relid therein
is now always present (rather than only in assertion-enabled builds).
Other than that it's just minor code rearrangement and added comments.

Author: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
Reported-by: Nikita Kalinin <n(dot)kalinin(at)postgrespro(dot)ru>
Suggested-by: Zhijie Hou <houzj(dot)fnst(at)fujitsu(dot)com>
Reviewed-by: Antonin Houska <ah(at)cybertec(dot)at> (older version)
Reviewed-by: Srinath Reddy Sadipiralla <srinath2133(at)gmail(dot)com> (older version)
Discussion: https://postgr.es/m/19500-38a02529a69353a5@postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/cd7b204b2df99516a48a738e662d8512e706b519

Modified Files
--------------
contrib/test_decoding/expected/repack.out | 11 +++
contrib/test_decoding/sql/repack.sql | 7 ++
src/backend/commands/repack_worker.c | 102 ++++++++++++----------------
src/backend/replication/pgrepack/pgrepack.c | 20 +++++-
src/include/commands/repack_internal.h | 2 -
5 files changed, 79 insertions(+), 63 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Masahiko Sawada 2026-06-09 18:19:49 pgsql: Fix race when logical decoding activation is concurrently interr
Previous Message Peter Eisentraut 2026-06-09 11:03:06 pgsql: Record dependencies on graph labels and properties