postgres.git / summary / log / commit / refs

commit    bc06faeb78c0e66927cd04f46ed8b5d41ab18427
Author:   Kevin Grittner <kgrittn@postgresql.org>
Date:     Wed Nov 06 18:26:36 2013 +0000
First released in: 9.4.0, 9.3.2

    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


src/backend/commands/matview.c | 4 ++-- 1 file 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. [parent: b47487138533]