Skip to content

Commit 74ef810

Browse files
committed
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.
1 parent a65ed83 commit 74ef810

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/backend/catalog/storage.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/catalog/storage.c,v 1.3 2009/01/01 17:23:37 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/catalog/storage.c,v 1.4 2009/01/04 14:59:22 heikki Exp $
1212
*
1313
* NOTES
1414
* Some of this code used to be in storage/smgr/smgr.c, and the
@@ -106,7 +106,7 @@ RelationCreateStorage(RelFileNode rnode, bool istemp)
106106
srel = smgropen(rnode);
107107
smgrcreate(srel, MAIN_FORKNUM, false);
108108

109-
if (istemp)
109+
if (!istemp)
110110
{
111111
/*
112112
* Make an XLOG entry showing the file creation. If we abort, the file
@@ -203,7 +203,7 @@ RelationTruncate(Relation rel, BlockNumber nblocks)
203203
* harmless failure to truncate, that could spell trouble at WAL replay,
204204
* into a certain PANIC.
205205
*/
206-
if (rel->rd_istemp)
206+
if (!rel->rd_istemp)
207207
{
208208
/*
209209
* Make an XLOG entry showing the file truncation.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy