| From: | Baji Shaik <baji(dot)pgdev(at)gmail(dot)com> |
|---|---|
| To: | pgsql-hackers(at)lists(dot)postgresql(dot)org |
| Cc: | Álvaro Herrera <alvherre(at)kurilemu(dot)de> |
| Subject: | [PATCH] Improve REPACK (CONCURRENTLY) error messages for unsupported configurations |
| Date: | 2026-05-27 03:06:13 |
| Message-ID: | CA+fm-ROdgh0rEVuXoViBk4TVgjodrN=MTR_RYuOuKLZ9voX4YA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
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
| Attachment | Content-Type | Size |
|---|---|---|
| 0003-Add-missing-errcode-to-REPACK-CONCURRENTLY-ereport-c.patch | application/octet-stream | 2.9 KB |
| 0002-Improve-REPACK-CONCURRENTLY-errors-for-unusable-iden.patch | application/octet-stream | 3.9 KB |
| 0001-Improve-REPACK-CONCURRENTLY-error-when-wal_level-rep.patch | application/octet-stream | 2.1 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Peter Smith | 2026-05-27 03:37:32 | Re: Support EXCEPT for ALL SEQUENCES publications |
| Previous Message | Tatsuo Ishii | 2026-05-27 02:49:06 | Re: Row pattern recognition |