Content-Length: 289702 | pFad | http://github.com/postgrespro/postgres_cluster/commit/21e28e4531e761e7cdf1b9a0bbf0c06f6107686a

05 Fix cache flush hazard in ExecRefreshMatView. · postgrespro/postgres_cluster@21e28e4 · GitHub
Skip to content

Commit 21e28e4

Browse files
committed
Fix cache flush hazard in ExecRefreshMatView.
Andres Freund
1 parent 2e44770 commit 21e28e4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/backend/commands/matview.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ ExecRefreshMatView(RefreshMatViewStmt *stmt, const char *queryString,
141141
List *actions;
142142
Query *dataQuery;
143143
Oid tableSpace;
144+
Oid owner;
144145
Oid OIDNewHeap;
145146
DestReceiver *dest;
146147
bool concurrent;
@@ -238,6 +239,8 @@ ExecRefreshMatView(RefreshMatViewStmt *stmt, const char *queryString,
238239
else
239240
tableSpace = matviewRel->rd_rel->reltablespace;
240241

242+
owner = matviewRel->rd_rel->relowner;
243+
241244
heap_close(matviewRel, NoLock);
242245

243246
/* Create the transient table that will receive the regenerated data. */
@@ -247,8 +250,7 @@ ExecRefreshMatView(RefreshMatViewStmt *stmt, const char *queryString,
247250

248251
/* Generate the data, if wanted. */
249252
if (!stmt->skipData)
250-
refresh_matview_datafill(dest, dataQuery, queryString,
251-
matviewRel->rd_rel->relowner);
253+
refresh_matview_datafill(dest, dataQuery, queryString, owner);
252254

253255
/* Make the matview match the newly generated data. */
254256
if (concurrent)

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/21e28e4531e761e7cdf1b9a0bbf0c06f6107686a

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy