git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e4155c8)
Make RecordTransactionCommit() respect wal_level.
2010年8月13日 15:42:21 +0000 (15:42 +0000)
2010年8月13日 15:42:21 +0000 (15:42 +0000)
Since the only purpose of WAL-loggin SharedInvalidationMessages is to support
Hot Standby operation, they needn't be included when wal_level < hot_standby.

Back-patch to 9.0.

Review by Heikki Linnakanagas and Fujii Masao.


diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c
index 37764891d7f26837c5e24754dcbcf699f379ef07..0491d2c8d91b836442af3ee1fa23faa1f04b3294 100644 (file)
--- a/src/backend/access/transam/xact.c
+++ b/src/backend/access/transam/xact.c
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.296 2010年08月12日 23:24:53 rhaas Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.297 2010年08月13日 15:42:21 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
@@ -915,15 +915,16 @@ RecordTransactionCommit(void)
bool haveNonTemp;
int nchildren;
TransactionId *children;
- int nmsgs;
+ int nmsgs = 0;
SharedInvalidationMessage *invalMessages = NULL;
- bool RelcacheInitFileInval;
+ bool RelcacheInitFileInval = false;
/* Get data needed for commit record */
nrels = smgrGetPendingDeletes(true, &rels, &haveNonTemp);
nchildren = xactGetCommittedChildren(&children);
- nmsgs = xactGetCommittedInvalidationMessages(&invalMessages,
- &RelcacheInitFileInval);
+ if (XLogStandbyInfoActive())
+ nmsgs = xactGetCommittedInvalidationMessages(&invalMessages,
+ &RelcacheInitFileInval);
/*
* If we haven't been assigned an XID yet, we neither can, nor do we want
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /