aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/smgr/smgr.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2008-06-12 09:12:31 +0000
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2008-06-12 09:12:31 +0000
commita213f1ee6c5a1bbe1f074ca201975e76ad2ed50c (patch)
treec5ac3531c006389123da3ba506e5b25eb09ecd02 /src/backend/storage/smgr/smgr.c
parentc4f2a0458dc029d1214f013f1434f70f5194e56d (diff)
downloadpostgresql-a213f1ee6c5a1bbe1f074ca201975e76ad2ed50c.tar.gz
postgresql-a213f1ee6c5a1bbe1f074ca201975e76ad2ed50c.zip
Refactor XLogOpenRelation() and XLogReadBuffer() in preparation for relation
forks. XLogOpenRelation() and the associated light-weight relation cache in xlogutils.c is gone, and XLogReadBuffer() now takes a RelFileNode as argument, instead of Relation. For functions that still need a Relation struct during WAL replay, there's a new function called CreateFakeRelcacheEntry() that returns a fake entry like XLogOpenRelation() used to.
Diffstat (limited to 'src/backend/storage/smgr/smgr.c')
-rw-r--r--src/backend/storage/smgr/smgr.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/backend/storage/smgr/smgr.c b/src/backend/storage/smgr/smgr.c
index 3f57a2d1b39..d0282f8a6d7 100644
--- a/src/backend/storage/smgr/smgr.c
+++ b/src/backend/storage/smgr/smgr.c
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/storage/smgr/smgr.c,v 1.109 2008/01/01 19:45:52 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/storage/smgr/smgr.c,v 1.110 2008/06/12 09:12:31 heikki Exp $
*
*-------------------------------------------------------------------------
*/
@@ -331,6 +331,13 @@ smgrcreate(SMgrRelation reln, bool isTemp, bool isRedo)
PendingRelDelete *pending;
/*
+ * Exit quickly in WAL replay mode if we've already opened the file.
+ * If it's open, it surely must exist.
+ */
+ if (isRedo && reln->md_fd != NULL)
+ return;
+
+ /*
* We may be using the target table space for the first time in this
* database, so create a per-database subdirectory if needed.
*