record_transaction_commmit.patch

application/octet-stream

Filename: record_transaction_commmit.patch
Type: application/octet-stream
Part: 0
Message: Re: RecordTransactionCommit() and SharedInvalidationMessages

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: unified
File+
src/backend/access/transam/xact.c 5 2
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c
index 60e22d0..2d21fdf 100644
--- a/src/backend/access/transam/xact.c
+++ b/src/backend/access/transam/xact.c
@@ -922,8 +922,11 @@ RecordTransactionCommit(void)
 	/* Get data needed for commit record */
 	nrels = smgrGetPendingDeletes(true, &rels, &haveNonTemp);
 	nchildren = xactGetCommittedChildren(&children);
-	nmsgs = xactGetCommittedInvalidationMessages(&invalMessages,
-												 &RelcacheInitFileInval);
+	if (wal_level == WAL_LEVEL_HOT_STANDBY)
+		nmsgs = xactGetCommittedInvalidationMessages(&invalMessages,
+													 &RelcacheInitFileInval);
+	else
+		nmsgs = 0;
 
 	/*
 	 * If we haven't been assigned an XID yet, we neither can, nor do we want