mirror of
https://github.com/postgres/postgres.git
synced 2025-04-27 22:56:53 +03:00
Fix cache flush hazard in ExecRefreshMatView.
Andres Freund
This commit is contained in:
parent
2e44770fa3
commit
21e28e4531
@ -141,6 +141,7 @@ ExecRefreshMatView(RefreshMatViewStmt *stmt, const char *queryString,
|
|||||||
List *actions;
|
List *actions;
|
||||||
Query *dataQuery;
|
Query *dataQuery;
|
||||||
Oid tableSpace;
|
Oid tableSpace;
|
||||||
|
Oid owner;
|
||||||
Oid OIDNewHeap;
|
Oid OIDNewHeap;
|
||||||
DestReceiver *dest;
|
DestReceiver *dest;
|
||||||
bool concurrent;
|
bool concurrent;
|
||||||
@ -238,6 +239,8 @@ ExecRefreshMatView(RefreshMatViewStmt *stmt, const char *queryString,
|
|||||||
else
|
else
|
||||||
tableSpace = matviewRel->rd_rel->reltablespace;
|
tableSpace = matviewRel->rd_rel->reltablespace;
|
||||||
|
|
||||||
|
owner = matviewRel->rd_rel->relowner;
|
||||||
|
|
||||||
heap_close(matviewRel, NoLock);
|
heap_close(matviewRel, NoLock);
|
||||||
|
|
||||||
/* Create the transient table that will receive the regenerated data. */
|
/* Create the transient table that will receive the regenerated data. */
|
||||||
@ -247,8 +250,7 @@ ExecRefreshMatView(RefreshMatViewStmt *stmt, const char *queryString,
|
|||||||
|
|
||||||
/* Generate the data, if wanted. */
|
/* Generate the data, if wanted. */
|
||||||
if (!stmt->skipData)
|
if (!stmt->skipData)
|
||||||
refresh_matview_datafill(dest, dataQuery, queryString,
|
refresh_matview_datafill(dest, dataQuery, queryString, owner);
|
||||||
matviewRel->rd_rel->relowner);
|
|
||||||
|
|
||||||
/* Make the matview match the newly generated data. */
|
/* Make the matview match the newly generated data. */
|
||||||
if (concurrent)
|
if (concurrent)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user