diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c index 6276520860..90e02aecac 100644 --- a/src/backend/replication/logical/reorderbuffer.c +++ b/src/backend/replication/logical/reorderbuffer.c @@ -5771,13 +5771,12 @@ ReorderBufferFilterByRelFileLocator(ReorderBuffer *rb, TransactionId xid, { if (IsToastRelation(relation)) { - Oid real_reloid = InvalidOid; char *toast_name = RelationGetRelationName(relation); - /* pg_toast_ len is 9 */ - char *start_ch = &toast_name[9]; + int n PG_USED_FOR_ASSERTS_ONLY; - real_reloid = pg_strtoint32(start_ch); - entry->relid = real_reloid; + n = sscanf(toast_name, "pg_toast_%u", &entry->relid); + + Assert(n == 1); } else entry->relid = RelationGetRelid(relation);