Avoid use of already-closed relcache entry.

Oversight in commit 17f8ffa1e.  Per buildfarm member prion.
This commit is contained in:
Tom Lane 2017-03-18 18:43:06 -04:00
parent 17f8ffa1e3
commit e3044f6184
1 changed files with 2 additions and 2 deletions

View File

@ -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);