agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Amit Langote <amitlan@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid ABI break in ModifyTableState from the FDW pruning fix
Date: Thu, 25 Jun 2026 11:45:12 +0000
Message-ID: <E1wciW8-0009XQ-15@gemulon.postgresql.org> (raw)

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

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/bba4e095d25005dd0b2f180187ff2c2adf48a3b3

Modified Files
--------------
src/backend/commands/explain.c         | 36 +++++++++++++++++++++++++++++++++-
src/backend/executor/nodeModifyTable.c |  1 -
src/include/nodes/execnodes.h          |  8 +++-----
3 files changed, 38 insertions(+), 7 deletions(-)



Message-ID: <E1wciW8-0009XQ-15@gemulon.postgresql.org>
Permalink:  ../E1wciW8-0009XQ-15@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wciW8-0009XQ-15@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: amitlan@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Avoid ABI break in ModifyTableState from the FDW pruning fix
  In-Reply-To: <E1wciW8-0009XQ-15@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