Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5829082

Browse files
committed
Keep heap open until new heap generated in RMV.
Early close became apparent when invalidation messages were processed in a new location under CLOBBER_CACHE_ALWAYS builds, due to additional locking. Back-patch to 9.3
1 parent 0ea5325 commit 5829082

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/commands/matview.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,6 @@ ExecRefreshMatView(RefreshMatViewStmt *stmt, const char *queryString,
239239

240240
owner = matviewRel->rd_rel->relowner;
241241

242-
heap_close(matviewRel, NoLock);
243-
244242
/*
245243
* Create the transient table that will receive the regenerated data.
246244
* Lock it against access by any other process until commit (by which time
@@ -255,6 +253,8 @@ ExecRefreshMatView(RefreshMatViewStmt *stmt, const char *queryString,
255253
if (!stmt->skipData)
256254
refresh_matview_datafill(dest, dataQuery, queryString, owner);
257255

256+
heap_close(matviewRel, NoLock);
257+
258258
/* Make the matview match the newly generated data. */
259259
if (concurrent)
260260
{

0 commit comments

Comments
 (0)