Avoid ABI break in ModifyTableState from the FDW pruning fix
Amit Langote <amitlan@postgresql.org>
Avoid ABI break in ModifyTableState from the FDW pruning fix Commit 1ef917e3a6 fixed the re-indexing of ModifyTable's FDW arrays when initial runtime pruning removes result relations, but it did so by adding a new mt_fdwPrivLists field to ModifyTableState. Although the field was placed at the end of the struct to keep the offsets of existing fields stable, it still enlarges sizeof(ModifyTableState), which the ABI compliance check flags on the buildfarm (e.g. crake). The field existed only so that show_modifytable_info() could recover the re-indexed fdw_private after executor startup; the executor-side fix in ExecInitModifyTable() that actually prevents the crash does not depend on it. Remove the field and have show_modifytable_info() instead look up each kept relation's fdw_private from the original, pre-pruning node->fdwPrivLists, which is parallel to node->resultRelations and left intact by pruning. When nothing was pruned the lookup is a direct index; otherwise it matches on the range table index. This is applied to REL_18 only; master keeps the mt_fdwPrivLists field and is unaffected, so the two diverge slightly here. Reported on the buildfarm (member crake). Per a suggestion from Tom Lane. Reviewed-by: Etsuro Fujita <etsuro.fujita@gmail.com> Discussion: https://postgr.es/m/CA+HiwqEhe7-v5Q0-oOoW3RaO4voYcGK-JfinbYEWXwutDGSOtQ@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/explain.c | modified | +35 −1 |
| src/backend/executor/nodeModifyTable.c | modified | +0 −1 |
| src/include/nodes/execnodes.h | modified | +3 −5 |
Discussion
- BUG #19484: Segmentation fault triggered by FDW 32 messages · 2026-05-18 → 2026-06-25