Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2036b3f

Browse files
committed
Disable VACUUM from being called from a function because function memory
would be cleared by vacuum; fix idea from Tom Lane.
1 parent5b92d00 commit2036b3f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎src/backend/commands/vacuum.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*
1414
*
1515
* 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 $
1717
*
1818
*-------------------------------------------------------------------------
1919
*/
@@ -181,6 +181,10 @@ vacuum(VacuumStmt *vacstmt)
181181
if (IsTransactionBlock())
182182
elog(ERROR,"%s cannot run inside a BEGIN/END block",stmttype);
183183

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+
184188
/*
185189
* Send info about dead objects to the statistics collector
186190
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp