Thread
-
[PATCH] Improve REPACK (CONCURRENTLY) error messages for unsupported configurations
Baji Shaik <baji.pgdev@gmail.com> — 2026-05-27T03:06:13Z
Hi, While exploring the new REPACK (CONCURRENTLY) feature, I noticed a few user-facing error paths that could be made more accurate. Patch series of three: 0001 -- When wal_level < replica, REPACK (CONCURRENTLY) currently surfaces generic "replication slots ... wal_level" error from CheckSlotRequirements(), with a CONTEXT line referring to an internal worker. Add an upfront check that reports a REPACK-specific error. 0002 -- check_concurrent_repack_requirements() reports the same generic "no identity index" error for several distinct cases, two of which are misleading: REPLICA IDENTITY FULL (which is set, but the hint says there is no identity), and a deferrable PK as the only identity (skipped per commit 832e220d99a, but the hint suggests adding an index that already exists). Distinguish these cases. 0003 -- Four ereport(ERROR) calls in the REPACK CONCURRENTLY code path lack errcode() and default to ERRCODE_INTERNAL_ERROR. Add appropriate errcodes; in particular, the apply_concurrent_update/delete failures map cleanly to ERRCODE_T_R_SERIALIZATION_FAILURE. All three are error-path only; the success path is unchanged. Each patch is independently committable. Detailed rationale is in the individual commit messages. Tested with `make check` (245/245 pass) and `make isolation/check` (128/128 pass) on top of master; 0002 also updates src/test/regress/expected/cluster.out to match the new deferrable-PK message. Thanks, Baji Shaik