*** pgsql/src/backend/access/nbtree/nbtsort.c 2010/01/15 09:19:00 1.122 --- pgsql/src/backend/access/nbtree/nbtsort.c 2010/01/20 19:43:40 1.123 *************** *** 59,65 **** * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION ! * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtsort.c,v 1.121 2010/01/02 16:57:35 momjian Exp $ * *------------------------------------------------------------------------- */ --- 59,65 ---- * 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 $ * *------------------------------------------------------------------------- */ *************** _bt_leafbuild(BTSpool *btspool, BTSpool *** 215,220 **** --- 215,232 ---- */ 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;