pgsql: Use appropriate tuple descriptor in FDW batching

From: Tomas Vondra <tomas(dot)vondra(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Use appropriate tuple descriptor in FDW batching
Date: 2021-08-12 20:10:17
Message-ID: E1mEH1t-0004TT-30@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Use appropriate tuple descriptor in FDW batching

The FDW batching code was using the same tuple descriptor both for all
slots (regular and plan slots), but that's incorrect - the subplan may
use a different descriptor. Currently this is benign, because batching
is used only for INSERTs, and in that case the descriptors always match.
But that would change if we allow batching UPDATEs.

Fix by copying the appropriate tuple descriptor. Backpatch to 14, where
the FDW batching was implemented.

Author: Amit Langote
Backpatch-through: 14, where FDW batching was added
Discussion: https://postgr.es/m/CA%2BHiwqEWd5B0-e-RvixGGUrNvGkjH2s4m95%3DJcwUnyV%3Df0rAKQ%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/650663b4cb4714a34d7171981de4392486a85f86

Modified Files
--------------
src/backend/executor/nodeModifyTable.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Thomas Munro 2021-08-13 00:03:47 pgsql: Make EXEC_BACKEND more convenient on macOS.
Previous Message Tomas Vondra 2021-08-12 20:09:47 pgsql: Use appropriate tuple descriptor in FDW batching