diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c index e6e14c5fb02..0a84443208f 100644 --- a/src/backend/replication/logical/reorderbuffer.c +++ b/src/backend/replication/logical/reorderbuffer.c @@ -2355,7 +2355,10 @@ ReorderBufferProcessTXN(ReorderBuffer *rb, ReorderBufferTXN *txn, elog(ERROR, "could not open relation with OID %u", relid); if (!RelationIsLogicallyLogged(relation)) + { + RelationClose(relation); continue; + } relations[nrelations++] = relation; }