|
13 | 13 | *
|
14 | 14 | *
|
15 | 15 | * IDENTIFICATION
|
16 |
| - * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.223 2002/04/12 20:38:25 tgl Exp $ |
| 16 | + * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.224 2002/04/15 23:39:42 momjian Exp $ |
17 | 17 | *
|
18 | 18 | *-------------------------------------------------------------------------
|
19 | 19 | */
|
@@ -181,6 +181,10 @@ vacuum(VacuumStmt *vacstmt)
|
181 | 181 | if (IsTransactionBlock())
|
182 | 182 | elog(ERROR,"%s cannot run inside a BEGIN/END block",stmttype);
|
183 | 183 |
|
| 184 | +/* Running VACUUM from a function would free the function context */ |
| 185 | +if (!MemoryContextContains(QueryContext,vacstmt)) |
| 186 | +elog(ERROR,"%s cannot be executed from a function",stmttype); |
| 187 | + |
184 | 188 | /*
|
185 | 189 | * Send info about dead objects to the statistics collector
|
186 | 190 | */
|
|