*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/postmaster/autovacuum.c,v 1.5.2.8 2008/01/17 23:47:07 alvherre Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/autovacuum.c,v 1.5.2.9 2009/01/20 12:17:29 alvherre Exp $
*
*-------------------------------------------------------------------------
*/
bool freeze)
{
VacuumStmt *vacstmt;
- MemoryContext old_cxt;
/*
* The node must survive transaction boundaries, so make sure we create it
* in a long-lived context
*/
- old_cxt = MemoryContextSwitchTo(AutovacMemCxt);
+ MemoryContextSwitchTo(AutovacMemCxt);
vacstmt = makeNode(VacuumStmt);
vacuum(vacstmt, relids);
pfree(vacstmt);
- MemoryContextSwitchTo(old_cxt);
+
+ /* Make sure we end up pointing to the long-lived context at exit */
+ MemoryContextSwitchTo(AutovacMemCxt);
}
/*