postgresql/src/include/nodes
Heikki Linnakangas f49b85d783 Clean up code to resolve the "root target relation" in nodeModifyTable.c
When executing DDL on a partitioned table or on a table with inheritance
children, statement-level triggers must be fired against the table given
in the original statement. The code to look that up was a bit messy and
duplicative. Commit 501ed02cf6 added a helper function,
getASTriggerResultRelInfo() (later renamed to getTargetResultRelInfo())
for it, but for some reason it was only used when firing AFTER STATEMENT
triggers and the code to fire BEFORE STATEMENT triggers duplicated the
logic.

Determine the target relation in ExecInitModifyTable(), and set it always
in ModifyTableState. Code that used to call getTargetResultRelInfo() can
now use ModifyTableState->rootResultRelInfo directly.

Discussion: https://www.postgresql.org/message-id/CA%2BHiwqFViT47Zbr_ASBejiK7iDG8%3DQ1swQ-tjM6caRPQ67pT%3Dw%40mail.gmail.com
2020-10-19 14:42:40 +03:00
..
bitmapset.h Move bitmap_hash and bitmap_match to bitmapset.c. 2020-02-24 17:17:43 +05:30
execnodes.h Clean up code to resolve the "root target relation" in nodeModifyTable.c 2020-10-19 14:42:40 +03:00
extensible.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
lockoptions.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
makefuncs.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
memnodes.h Revert "Specialize MemoryContextMemAllocated()." 2020-03-19 12:21:50 -07:00
nodeFuncs.h Suppress unnecessary RelabelType nodes in yet more cases. 2020-08-19 14:07:49 -04:00
nodes.h Move resolution of AlternativeSubPlan choices to the planner. 2020-09-27 12:51:28 -04:00
params.h Initial pgindent and pgperltidy run for v13. 2020-05-14 13:06:50 -04:00
parsenodes.h Allow CURRENT_ROLE where CURRENT_USER is accepted 2020-09-17 11:40:08 +02:00
pathnodes.h Create ResultRelInfos later in InitPlan, index them by RT index. 2020-10-13 12:57:02 +03:00
pg_list.h Add for_each_from, to simplify loops starting from non-first list cells. 2020-09-28 20:33:13 -04:00
plannodes.h Include result relation info in direct modify ForeignScan nodes. 2020-10-14 10:58:38 +03:00
primnodes.h Move resolution of AlternativeSubPlan choices to the planner. 2020-09-27 12:51:28 -04:00
print.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
readfuncs.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
replnodes.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
supportnodes.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
tidbitmap.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
value.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00