diff options
author | Kevin Grittner <kgrittn@postgresql.org> | 2013-11-06 12:26:36 -0600 |
---|---|---|
committer | Kevin Grittner <kgrittn@postgresql.org> | 2013-11-06 12:26:36 -0600 |
commit | bc06faeb78c0e66927cd04f46ed8b5d41ab18427 (patch) | |
tree | 0e8a5bde54d01e4a99e7c7285e7cd1ed8c55ed78 /src/backend/commands/matview.c | |
parent | b47487138533075be1c558310685d4d822b7acb9 (diff) | |
download | postgresql-bc06faeb78c0e66927cd04f46ed8b5d41ab18427.tar.gz postgresql-bc06faeb78c0e66927cd04f46ed8b5d41ab18427.zip |
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
Diffstat (limited to 'src/backend/commands/matview.c')
-rw-r--r-- | src/backend/commands/matview.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/commands/matview.c b/src/backend/commands/matview.c index f7b3244752e..acf9564c336 100644 --- a/src/backend/commands/matview.c +++ b/src/backend/commands/matview.c @@ -208,8 +208,6 @@ ExecRefreshMatView(RefreshMatViewStmt *stmt, const char *queryString, tableSpace = matviewRel->rd_rel->reltablespace; - heap_close(matviewRel, NoLock); - /* Create the transient table that will receive the regenerated data. */ OIDNewHeap = make_new_heap(matviewOid, tableSpace); dest = CreateTransientRelDestReceiver(OIDNewHeap); @@ -218,6 +216,8 @@ ExecRefreshMatView(RefreshMatViewStmt *stmt, const char *queryString, if (!stmt->skipData) refresh_matview_datafill(dest, dataQuery, queryString); + heap_close(matviewRel, NoLock); + /* * Swap the physical files of the target and transient tables, then * rebuild the target's indexes and throw away the transient table. |