File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 55
55
*
56
56
*
57
57
* IDENTIFICATION
58
- * $PostgreSQL: pgsql/src/backend/postmaster/autovacuum.c,v 1.64 2007/10/25 14:45:55 alvherre Exp $
58
+ * $PostgreSQL: pgsql/src/backend/postmaster/autovacuum.c,v 1.65 2007/10/25 19:13:37 alvherre Exp $
59
59
*
60
60
*-------------------------------------------------------------------------
61
61
*/
@@ -2099,11 +2099,9 @@ do_autovacuum(void)
2099
2099
2100
2100
/*
2101
2101
* Save the relation name for a possible error message, to avoid a
2102
- * catalog lookup in case of an error. We do it in
2103
- * TopTransactionContext so that they go away automatically in the next
2104
- * iteration.
2102
+ * catalog lookup in case of an error. Note: they must live in a
2103
+ * long-lived memory context.
2105
2104
*/
2106
- MemoryContextSwitchTo (TopTransactionContext );
2107
2105
datname = get_database_name (MyDatabaseId );
2108
2106
nspname = get_namespace_name (get_rel_namespace (tab -> at_relid ));
2109
2107
relname = get_rel_name (tab -> at_relid );
@@ -2116,6 +2114,7 @@ do_autovacuum(void)
2116
2114
PG_TRY ();
2117
2115
{
2118
2116
/* have at it */
2117
+ MemoryContextSwitchTo (TopTransactionContext );
2119
2118
autovacuum_do_vac_analyze (tab -> at_relid ,
2120
2119
tab -> at_dovacuum ,
2121
2120
tab -> at_doanalyze ,
@@ -2152,6 +2151,9 @@ do_autovacuum(void)
2152
2151
2153
2152
/* be tidy */
2154
2153
pfree (tab );
2154
+ pfree (datname );
2155
+ pfree (nspname );
2156
+ pfree (relname );
2155
2157
2156
2158
/* remove my info from shared memory */
2157
2159
LWLockAcquire (AutovacuumLock , LW_EXCLUSIVE );
You can’t perform that action at this time.
0 commit comments