mirror of
https://github.com/postgres/postgres.git
synced 2025-07-14 08:21:07 +03:00
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
This commit is contained in:
@ -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 */
|
||||
|
Reference in New Issue
Block a user