Commit e3044f61 authored by Tom Lane's avatar Tom Lane

Avoid use of already-closed relcache entry.

Oversight in commit 17f8ffa1.  Per buildfarm member prion.
parent 17f8ffa1
......@@ -326,8 +326,6 @@ ExecRefreshMatView(RefreshMatViewStmt *stmt, const char *queryString,
if (!stmt->skipData)
processed = refresh_matview_datafill(dest, dataQuery, queryString);
heap_close(matviewRel, NoLock);
/* Make the matview match the newly generated data. */
if (concurrent)
{
......@@ -361,6 +359,8 @@ ExecRefreshMatView(RefreshMatViewStmt *stmt, const char *queryString,
pgstat_count_heap_insert(matviewRel, processed);
}
heap_close(matviewRel, NoLock);
/* Roll back any GUC changes */
AtEOXact_GUC(false, save_nestlevel);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment