postgresql/contrib/test_decoding
Álvaro Herrera cd7b204b2d
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
2026-06-09 20:12:55 +02:00
..
expected Disallow direct use of the pgrepack logical decoding plugin 2026-06-09 20:12:55 +02:00
specs Prevent unintended dropping of active replication origins. 2026-01-14 07:15:46 +00:00
sql Disallow direct use of the pgrepack logical decoding plugin 2026-06-09 20:12:55 +02:00
t Update copyright for 2026 2026-01-01 13:24:10 -05:00
.gitignore Improve isolation tests infrastructure. 2017-03-14 15:56:17 -07:00
logical.conf Stabilize streaming tests in test_decoding. 2022-04-20 08:59:55 +05:30
Makefile Move REPACK (CONCURRENTLY) test out of stock regression tests 2026-04-23 12:34:41 +02:00
meson.build Move REPACK (CONCURRENTLY) test out of stock regression tests 2026-04-23 12:34:41 +02:00
test_decoding.c Standardize replication origin naming to use "ReplOrigin". 2026-01-28 11:03:29 -08:00