@ -30,6 +30,7 @@
# include "miscadmin.h"
# include "miscadmin.h"
# include "parser/parse_relation.h"
# include "parser/parse_relation.h"
# include "rewrite/rewriteHandler.h"
# include "rewrite/rewriteHandler.h"
# include "storage/lmgr.h"
# include "storage/smgr.h"
# include "storage/smgr.h"
# include "tcop/tcopprot.h"
# include "tcop/tcopprot.h"
# include "utils/builtins.h"
# include "utils/builtins.h"
@ -240,9 +241,14 @@ ExecRefreshMatView(RefreshMatViewStmt *stmt, const char *queryString,
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 .
* Lock it against access by any other process until commit ( by which time
* it will be gone ) .
*/
OIDNewHeap = make_new_heap ( matviewOid , tableSpace , concurrent ,
OIDNewHeap = make_new_heap ( matviewOid , tableSpace , concurrent ,
ExclusiveLock ) ;
ExclusiveLock ) ;
LockRelationOid ( OIDNewHeap , AccessExclusiveLock ) ;
dest = CreateTransientRelDestReceiver ( OIDNewHeap ) ;
dest = CreateTransientRelDestReceiver ( OIDNewHeap ) ;
/* Generate the data, if wanted. */
/* Generate the data, if wanted. */