MCPcopy Create free account
hub / github.com/apache/cloudberry / fireASTriggers

Function fireASTriggers

src/backend/executor/nodeModifyTable.c:2507–2535  ·  view source on GitHub ↗

* Process AFTER EACH STATEMENT triggers */

Source from the content-addressed store, hash-verified

2505 * Process AFTER EACH STATEMENT triggers
2506 */
2507void
2508fireASTriggers(ModifyTableState *node)
2509{
2510 ModifyTable *plan = (ModifyTable *) node->ps.plan;
2511 ResultRelInfo *resultRelInfo = node->rootResultRelInfo;
2512
2513 switch (node->operation)
2514 {
2515 case CMD_INSERT:
2516 if (plan->onConflictAction == ONCONFLICT_UPDATE)
2517 ExecASUpdateTriggers(node->ps.state,
2518 resultRelInfo,
2519 node->mt_oc_transition_capture);
2520 ExecASInsertTriggers(node->ps.state, resultRelInfo,
2521 node->mt_transition_capture);
2522 break;
2523 case CMD_UPDATE:
2524 ExecASUpdateTriggers(node->ps.state, resultRelInfo,
2525 node->mt_transition_capture);
2526 break;
2527 case CMD_DELETE:
2528 ExecASDeleteTriggers(node->ps.state, resultRelInfo,
2529 node->mt_transition_capture);
2530 break;
2531 default:
2532 elog(ERROR, "unknown operation");
2533 break;
2534 }
2535}
2536
2537/*
2538 * Set up the state needed for collecting transition tuples for AFTER

Callers 2

ExecPostprocessPlanFunction · 0.85
ExecModifyTableFunction · 0.85

Calls 3

ExecASUpdateTriggersFunction · 0.85
ExecASInsertTriggersFunction · 0.85
ExecASDeleteTriggersFunction · 0.85

Tested by

no test coverage detected