aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/execMain.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2020-10-19 14:11:44 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2020-10-19 14:42:40 +0300
commitf49b85d783f6781138f33bbe5f6e98da86907d84 (patch)
treea8b056023c829f7db9ca2711366f8258102ca832 /src/backend/executor/execMain.c
parent26ec6b5948a73d0e07ed9435ee4554594acdf34f (diff)
downloadpostgresql-f49b85d783f6781138f33bbe5f6e98da86907d84.tar.gz
postgresql-f49b85d783f6781138f33bbe5f6e98da86907d84.zip
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
Diffstat (limited to 'src/backend/executor/execMain.c')
0 files changed, 0 insertions, 0 deletions