aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/nbtree/nbtsort.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access/nbtree/nbtsort.c')
-rw-r--r--src/backend/access/nbtree/nbtsort.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/backend/access/nbtree/nbtsort.c b/src/backend/access/nbtree/nbtsort.c
index 68747beae5f..772215c1810 100644
--- a/src/backend/access/nbtree/nbtsort.c
+++ b/src/backend/access/nbtree/nbtsort.c
@@ -59,7 +59,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtsort.c,v 1.122 2010/01/15 09:19:00 heikki Exp $
+ * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtsort.c,v 1.123 2010/01/20 19:43:40 heikki Exp $
*
*-------------------------------------------------------------------------
*/
@@ -215,6 +215,18 @@ _bt_leafbuild(BTSpool *btspool, BTSpool *btspool2)
*/
wstate.btws_use_wal = XLogIsNeeded() && !wstate.index->rd_istemp;
+ /*
+ * Write an XLOG UNLOGGED record if WAL-logging was skipped because
+ * WAL archiving is not enabled.
+ */
+ if (!wstate.btws_use_wal && !wstate.index->rd_istemp)
+ {
+ char reason[NAMEDATALEN + 20];
+ snprintf(reason, sizeof(reason), "b-tree build on \"%s\"",
+ RelationGetRelationName(wstate.index));
+ XLogReportUnloggedStatement(reason);
+ }
+
/* reserve the metapage */
wstate.btws_pages_alloced = BTREE_METAPAGE + 1;
wstate.btws_pages_written = 0;