summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorKevin Grittner2013-07-16 17:55:44 +0000
committerKevin Grittner2013-07-16 17:55:44 +0000
commitcc1965a99bf87005f431804bbda0f723887a04d6 (patch)
tree694801e2e7a34a1247ad7858b9c81ff16a90ac39 /src/include
parent7f7485a0cde92aa4ba235a1ffe4dda0ca0b6cc9a (diff)
Add support for REFRESH MATERIALIZED VIEW CONCURRENTLY.
This allows reads to continue without any blocking while a REFRESH runs. The new data appears atomically as part of transaction commit. Review questioned the Assert that a matview was not a system relation. This will be addressed separately. Reviewed by Hitoshi Harada, Robert Haas, Andres Freund. Merged after review with security patch f3ab5d4.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/commands/cluster.h3
-rw-r--r--src/include/commands/matview.h2
-rw-r--r--src/include/nodes/parsenodes.h1
3 files changed, 5 insertions, 1 deletions
diff --git a/src/include/commands/cluster.h b/src/include/commands/cluster.h
index aa6d332e9d2..03d9f176c57 100644
--- a/src/include/commands/cluster.h
+++ b/src/include/commands/cluster.h
@@ -25,7 +25,8 @@ extern void check_index_is_clusterable(Relation OldHeap, Oid indexOid,
bool recheck, LOCKMODE lockmode);
extern void mark_index_clustered(Relation rel, Oid indexOid, bool is_internal);
-extern Oid make_new_heap(Oid OIDOldHeap, Oid NewTableSpace);
+extern Oid make_new_heap(Oid OIDOldHeap, Oid NewTableSpace, bool forcetemp,
+ LOCKMODE lockmode);
extern void finish_heap_swap(Oid OIDOldHeap, Oid OIDNewHeap,
bool is_system_catalog,
bool swap_toast_by_content,
diff --git a/src/include/commands/matview.h b/src/include/commands/matview.h
index dce724469e2..29229076a3d 100644
--- a/src/include/commands/matview.h
+++ b/src/include/commands/matview.h
@@ -27,4 +27,6 @@ extern void ExecRefreshMatView(RefreshMatViewStmt *stmt, const char *queryString
extern DestReceiver *CreateTransientRelDestReceiver(Oid oid);
+extern bool MatViewIncrementalMaintenanceIsEnabled(void);
+
#endif /* MATVIEW_H */
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h
index de22dff8935..bf81b5bddad 100644
--- a/src/include/nodes/parsenodes.h
+++ b/src/include/nodes/parsenodes.h
@@ -2478,6 +2478,7 @@ typedef struct CreateTableAsStmt
typedef struct RefreshMatViewStmt
{
NodeTag type;
+ bool concurrent; /* allow concurrent access? */
bool skipData; /* true for WITH NO DATA */
RangeVar *relation; /* relation to insert into */
} RefreshMatViewStmt;