postgresql/src/include/optimizer
Etsuro Fujita ce88170227 Disallow collecting transition tuples from child foreign tables.
Commit 9e6104c66 disallowed transition tables on foreign tables, but
failed to account for cases where a foreign table is a child table of a
partitioned/inherited table on which transition tables exist, leading to
incorrect transition tuples collected from such foreign tables for
queries on the parent table triggering transition capture.  This
occurred not only for inherited UPDATE/DELETE but for partitioned INSERT
later supported by commit 3d956d956, which should have handled it at
least for the INSERT case, but didn't.

To fix, modify ExecAR*Triggers to throw an error if the given relation
is a foreign table requesting transition capture.  Also, this commit
fixes make_modifytable so that in case of an inherited UPDATE/DELETE
triggering transition capture, FDWs choose normal operations to modify
child foreign tables, not DirectModify; which is needed because they
would otherwise skip the calls to ExecAR*Triggers at execution, causing
unexpected behavior.

Author: Etsuro Fujita <etsuro.fujita@gmail.com>
Reviewed-by: Amit Langote <amitlangote09@gmail.com>
Discussion: https://postgr.es/m/CAPmGK14QJYikKzBDCe3jMbpGENnQ7popFmbEgm-XTNuk55oyHg%40mail.gmail.com
Backpatch-through: 13
2025-08-08 10:50:01 +09:00
..
appendinfo.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
clauses.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
cost.h Track the number of presorted outer pathkeys in MergePath 2025-05-08 18:21:32 +09:00
geqo.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
geqo_copy.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
geqo_gene.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
geqo_misc.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
geqo_mutation.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
geqo_pool.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
geqo_random.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
geqo_recombination.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
geqo_selection.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
inherit.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
joininfo.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
optimizer.h Extract make_SAOP_expr() function from match_orclause_to_indexcol() 2025-04-04 16:01:28 +03:00
orclauses.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
paramassign.h Fix some new issues with planning of PlaceHolderVars. 2025-06-29 15:04:32 -04:00
pathnode.h Track the number of presorted outer pathkeys in MergePath 2025-05-08 18:21:32 +09:00
paths.h Remove planner's have_dangerous_phv() join-order restriction. 2025-06-20 15:55:12 -04:00
placeholder.h Fix some new issues with planning of PlaceHolderVars. 2025-06-29 15:04:32 -04:00
plancat.h Disallow collecting transition tuples from child foreign tables. 2025-08-08 10:50:01 +09:00
planmain.h Harmonize function parameter names for Postgres 18. 2025-04-12 12:07:36 -04:00
planner.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
prep.h Expand virtual generated columns in the planner 2025-02-25 16:10:25 +09:00
restrictinfo.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
subselect.h Convert 'x IN (VALUES ...)' to 'x = ANY ...' then appropriate 2025-04-04 16:01:50 +03:00
tlist.h Update copyright for 2025 2025-01-01 11:21:55 -05:00