From 005050e6867add6b1ff0d845550254a1ce95424b Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Sun, 4 Jan 2009 14:59:22 +0000 Subject: [PATCH] Fix embarrassing bug in recent smgr refactoring patch: WAL records should be written for *non*-temp tables only. Report and test case by Mark Kirkwood and Simon Riggs. --- src/backend/catalog/storage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/catalog/storage.c b/src/backend/catalog/storage.c index 869effeef3..e9008e3f2c 100644 --- a/src/backend/catalog/storage.c +++ b/src/backend/catalog/storage.c @@ -106,7 +106,7 @@ RelationCreateStorage(RelFileNode rnode, bool istemp) srel = smgropen(rnode); smgrcreate(srel, MAIN_FORKNUM, false); - if (istemp) + if (!istemp) { /* * Make an XLOG entry showing the file creation. If we abort, the file @@ -203,7 +203,7 @@ RelationTruncate(Relation rel, BlockNumber nblocks) * harmless failure to truncate, that could spell trouble at WAL replay, * into a certain PANIC. */ - if (rel->rd_istemp) + if (!rel->rd_istemp) { /* * Make an XLOG entry showing the file truncation. -- 2.39.5