Index: autovacuum.c =================================================================== RCS file: /cvsroot/pgsql/src/backend/postmaster/autovacuum.c,v retrieving revision 1.5.2.8 diff -c -r1.5.2.8 autovacuum.c *** autovacuum.c 17 Jan 2008 23:47:07 -0000 1.5.2.8 --- autovacuum.c 17 Jan 2009 15:31:05 -0000 *************** *** 925,937 **** 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); vacstmt = makeNode(VacuumStmt); --- 925,936 ---- bool freeze) { VacuumStmt *vacstmt; /* * The node must survive transaction boundaries, so make sure we create it * in a long-lived context */ ! MemoryContextSwitchTo(AutovacMemCxt); vacstmt = makeNode(VacuumStmt); *************** *** 957,963 **** vacuum(vacstmt, relids); pfree(vacstmt); ! MemoryContextSwitchTo(old_cxt); } /* --- 956,964 ---- vacuum(vacstmt, relids); pfree(vacstmt); ! ! /* Make sure we end up pointing to the long-lived context at exit */ ! MemoryContextSwitchTo(AutovacMemCxt); } /*