* Try to find a tuple received from the publication side (in 'remoteslot') in * the corresponding local relation using either replica identity index, * primary key or if needed, sequential scan. * * Local tuple, if found, is returned in '*localslot'. */
| 1628 | * Local tuple, if found, is returned in '*localslot'. |
| 1629 | */ |
| 1630 | static bool |
| 1631 | FindReplTupleInLocalRel(EState *estate, Relation localrel, |
| 1632 | LogicalRepRelation *remoterel, |
| 1633 | TupleTableSlot *remoteslot, |
| 1634 | TupleTableSlot **localslot) |
| 1635 | { |
| 1636 | Oid idxoid; |
| 1637 | bool found; |
| 1638 | |
| 1639 | *localslot = table_slot_create(localrel, &estate->es_tupleTable); |
| 1640 | |
| 1641 | idxoid = GetRelationIdentityOrPK(localrel); |
| 1642 | Assert(OidIsValid(idxoid) || |
| 1643 | (remoterel->replident == REPLICA_IDENTITY_FULL)); |
| 1644 | |
| 1645 | if (OidIsValid(idxoid)) |
| 1646 | found = RelationFindReplTupleByIndex(localrel, idxoid, |
| 1647 | LockTupleExclusive, |
| 1648 | remoteslot, *localslot); |
| 1649 | else |
| 1650 | found = RelationFindReplTupleSeq(localrel, LockTupleExclusive, |
| 1651 | remoteslot, *localslot); |
| 1652 | |
| 1653 | return found; |
| 1654 | } |
| 1655 | |
| 1656 | /* |
| 1657 | * This handles insert, update, delete on a partitioned table. |
no test coverage detected