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

Commit3573c83

Browse files
committed
Reset the per-output-tuple exprcontext each time through the main loop in
ExecModifyTable(). This avoids memory leakage when trigger functions leavejunk behind in that context (as they more or less must). Problem and solutionidentified by Dean Rasheed.I'm a bit concerned about the longevity of this solution --- once a plan canhave multiple ModifyTable nodes, we are very possibly going to have to dosomething different. But it should hold up for 9.0.
1 parent2d8314b commit3573c83

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

‎src/backend/executor/nodeModifyTable.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/nodeModifyTable.c,v 1.8 2010/07/12 17:01:05 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/nodeModifyTable.c,v 1.9 2010/08/18 21:52:24 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -682,6 +682,14 @@ ExecModifyTable(ModifyTableState *node)
682682
*/
683683
for (;;)
684684
{
685+
/*
686+
* Reset the per-output-tuple exprcontext. This is needed because
687+
* triggers expect to use that context as workspace. It's a bit ugly
688+
* to do this below the top level of the plan, however. We might need
689+
* to rethink this later.
690+
*/
691+
ResetPerTupleExprContext(estate);
692+
685693
planSlot=ExecProcNode(subplanstate);
686694

687695
if (TupIsNull(planSlot))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp