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

Commite86237f

Browse files
committed
Fix my brain fade in TRUNCATE triggers patch: can't release relcache refcounts
while EState still contains pointers to those relations. Exposed by theCLOBBER_CACHE_ALWAYS tests that buildfarm member jaguar is running (I knewthose cycles would pay off...)
1 parent3405f2b commite86237f

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

‎src/backend/commands/tablecmds.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.249 2008/03/28 00:21:55 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.250 2008/03/31 03:34:27 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -662,8 +662,6 @@ ExecuteTruncate(TruncateStmt *stmt)
662662
heap_relid=RelationGetRelid(rel);
663663
toast_relid=rel->rd_rel->reltoastrelid;
664664

665-
heap_close(rel,NoLock);
666-
667665
/*
668666
* The same for the toast table, if any.
669667
*/
@@ -696,6 +694,14 @@ ExecuteTruncate(TruncateStmt *stmt)
696694

697695
/* We can clean up the EState now */
698696
FreeExecutorState(estate);
697+
698+
/* And close the rels (can't do this while EState still holds refs) */
699+
foreach(cell,rels)
700+
{
701+
Relationrel= (Relation)lfirst(cell);
702+
703+
heap_close(rel,NoLock);
704+
}
699705
}
700706

701707
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp