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

Function ExecSimpleRelationDelete

src/backend/executor/execReplication.c:533–562  ·  view source on GitHub ↗

* Find the searchslot tuple and delete it, and execute any constraints * and per-row triggers. * * Caller is responsible for opening the indexes. */

Source from the content-addressed store, hash-verified

531 * Caller is responsible for opening the indexes.
532 */
533void
534ExecSimpleRelationDelete(ResultRelInfo *resultRelInfo,
535 EState *estate, EPQState *epqstate,
536 TupleTableSlot *searchslot)
537{
538 bool skip_tuple = false;
539 Relation rel = resultRelInfo->ri_RelationDesc;
540 ItemPointer tid = &searchslot->tts_tid;
541
542 CheckCmdReplicaIdentity(rel, CMD_DELETE);
543
544 /* BEFORE ROW DELETE Triggers */
545 if (resultRelInfo->ri_TrigDesc &&
546 resultRelInfo->ri_TrigDesc->trig_delete_before_row)
547 {
548 skip_tuple = !ExecBRDeleteTriggers(estate, epqstate, resultRelInfo,
549 tid, NULL, NULL);
550
551 }
552
553 if (!skip_tuple)
554 {
555 /* OK, delete the tuple */
556 simple_table_tuple_delete(rel, tid, estate->es_snapshot);
557
558 /* AFTER ROW DELETE Triggers */
559 ExecARDeleteTriggers(estate, resultRelInfo,
560 tid, NULL, NULL);
561 }
562}
563
564/*
565 * Check if command can be executed with current replica identity.

Callers 1

Calls 4

CheckCmdReplicaIdentityFunction · 0.85
ExecBRDeleteTriggersFunction · 0.85
ExecARDeleteTriggersFunction · 0.85

Tested by

no test coverage detected