v1_improve_assert_worker.patch
application/octet-stream
Filename: v1_improve_assert_worker.patch
Type: application/octet-stream
Part: 0
Patch
Format: unified
Series: patch v1
| File | + | − |
|---|---|---|
| src/backend/replication/logical/worker.c | 4 | 3 |
diff --git a/src/backend/replication/logical/worker.c b/src/backend/replication/logical/worker.c index 0fb577d328..925dff9cc4 100644 --- a/src/backend/replication/logical/worker.c +++ b/src/backend/replication/logical/worker.c @@ -2929,9 +2929,10 @@ FindReplTupleInLocalRel(ApplyExecutionData *edata, Relation localrel, Relation idxrel = index_open(localidxoid, AccessShareLock); /* Index must be PK, RI, or usable for REPLICA IDENTITY FULL tables */ - Assert(GetRelationIdentityOrPK(idxrel) == localidxoid || - IsIndexUsableForReplicaIdentityFull(BuildIndexInfo(idxrel), - edata->targetRel->attrmap)); + Assert(GetRelationIdentityOrPK(localrel) == localidxoid || + (remoterel->replident == REPLICA_IDENTITY_FULL && + IsIndexUsableForReplicaIdentityFull(BuildIndexInfo(idxrel), + edata->targetRel->attrmap))); index_close(idxrel, AccessShareLock); #endif