aboutsummaryrefslogtreecommitdiff
path: root/src/backend/replication/logical/decode.c
diff options
context:
space:
mode:
authorJeff Davis <jdavis@postgresql.org>2022-04-06 22:26:43 -0700
committerJeff Davis <jdavis@postgresql.org>2022-04-06 23:06:46 -0700
commit5c279a6d350205cc98f91fb8e1d3e4442a6b25d1 (patch)
tree4165add040730afa0e116ab5be1db5dc6fa93aea /src/backend/replication/logical/decode.c
parenta8cfb0c1a964ebbe830c5138d389b0d2627ec298 (diff)
downloadpostgresql-5c279a6d350205cc98f91fb8e1d3e4442a6b25d1.tar.gz
postgresql-5c279a6d350205cc98f91fb8e1d3e4442a6b25d1.zip
Custom WAL Resource Managers.
Allow extensions to specify a new custom resource manager (rmgr), which allows specialized WAL. This is meant to be used by a Table Access Method or Index Access Method. Prior to this commit, only Generic WAL was available, which offers support for recovery and physical replication but not logical replication. Reviewed-by: Julien Rouhaud, Bharath Rupireddy, Andres Freund Discussion: https://postgr.es/m/ed1fb2e22d15d3563ae0eb610f7b61bb15999c0a.camel%40j-davis.com
Diffstat (limited to 'src/backend/replication/logical/decode.c')
-rw-r--r--src/backend/replication/logical/decode.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/replication/logical/decode.c b/src/backend/replication/logical/decode.c
index 77bc7aea7a0..c6ea7c98e15 100644
--- a/src/backend/replication/logical/decode.c
+++ b/src/backend/replication/logical/decode.c
@@ -94,7 +94,7 @@ LogicalDecodingProcessRecord(LogicalDecodingContext *ctx, XLogReaderState *recor
{
XLogRecordBuffer buf;
TransactionId txid;
- RmgrId rmid;
+ RmgrData rmgr;
buf.origptr = ctx->reader->ReadRecPtr;
buf.endptr = ctx->reader->EndRecPtr;
@@ -115,10 +115,10 @@ LogicalDecodingProcessRecord(LogicalDecodingContext *ctx, XLogReaderState *recor
buf.origptr);
}
- rmid = XLogRecGetRmid(record);
+ rmgr = GetRmgr(XLogRecGetRmid(record));
- if (RmgrTable[rmid].rm_decode != NULL)
- RmgrTable[rmid].rm_decode(ctx, &buf);
+ if (rmgr.rm_decode != NULL)
+ rmgr.rm_decode(ctx, &buf);
else
{
/* just deal with xid, and done */