agora inbox for pgsql-committers@postgresql.org
help / color / mirror / Atom feedFrom: Álvaro Herrera <alvherre@kurilemu.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Disallow direct use of the pgrepack logical decoding plugin
Date: Tue, 09 Jun 2026 18:16:16 +0000
Message-ID: <E1wX0zo-001let-1I@gemulon.postgresql.org> (raw)
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@kurilemu.de>
Reported-by: Nikita Kalinin <n.kalinin@postgrespro.ru>
Suggested-by: Zhijie Hou <houzj.fnst@fujitsu.com>
Reviewed-by: Antonin Houska <ah@cybertec.at> (older version)
Reviewed-by: Srinath Reddy Sadipiralla <srinath2133@gmail.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(-)
Message-ID: <E1wX0zo-001let-1I@gemulon.postgresql.org>
Permalink: ../E1wX0zo-001let-1I@gemulon.postgresql.org/
Also on: postgresql.org/message-id/E1wX0zo-001let-1I@gemulon.postgresql.org
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: alvherre@kurilemu.de, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Disallow direct use of the pgrepack logical decoding plugin
In-Reply-To: <E1wX0zo-001let-1I@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox