* Find the searchslot tuple and delete it, and execute any constraints * and per-row triggers. * * Caller is responsible for opening the indexes. */
| 531 | * Caller is responsible for opening the indexes. |
| 532 | */ |
| 533 | void |
| 534 | ExecSimpleRelationDelete(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. |
no test coverage detected