*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/storage/smgr/smgr.c,v 1.97 2006/03/24 04:32:13 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/storage/smgr/smgr.c,v 1.98 2006/03/30 22:11:55 tgl Exp $
*
*-------------------------------------------------------------------------
*/
*/
FreeSpaceMapForgetRel(&rnode);
- /* Tell the stats collector to forget it immediately, too. */
- pgstat_drop_relation(rnode.relNode);
+ /*
+ * Tell the stats collector to forget it immediately, too. Skip this
+ * in recovery mode, since the stats collector likely isn't running
+ * (and if it is, pgstat.c will get confused because we aren't a real
+ * backend process).
+ */
+ if (!InRecovery)
+ pgstat_drop_relation(rnode.relNode);
/*
* And delete the physical files.