File tree 1 file changed +18
-12
lines changed
1 file changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -816,27 +816,33 @@ refresh_by_heap_swap(Oid matviewOid, Oid OIDNewHeap)
816
816
RelationCacheInvalidateEntry (matviewOid );
817
817
}
818
818
819
- static void
820
- OpenMatViewIncrementalMaintenance (void )
821
- {
822
- matview_maintenance_depth ++ ;
823
- }
824
-
825
- static void
826
- CloseMatViewIncrementalMaintenance (void )
827
- {
828
- matview_maintenance_depth -- ;
829
- Assert (matview_maintenance_depth >= 0 );
830
- }
831
819
832
820
/*
833
821
* This should be used to test whether the backend is in a context where it is
834
822
* OK to allow DML statements to modify materialized views. We only want to
835
823
* allow that for internal code driven by the materialized view definition,
836
824
* not for arbitrary user-supplied code.
825
+ *
826
+ * While the function names reflect the fact that their main intended use is
827
+ * incremental maintenance of materialized views (in response to changes to
828
+ * the data in referenced relations), they are initially used to allow REFRESH
829
+ * without blocking concurrent reads.
837
830
*/
838
831
bool
839
832
MatViewIncrementalMaintenanceIsEnabled (void )
840
833
{
841
834
return matview_maintenance_depth > 0 ;
842
835
}
836
+
837
+ static void
838
+ OpenMatViewIncrementalMaintenance (void )
839
+ {
840
+ matview_maintenance_depth ++ ;
841
+ }
842
+
843
+ static void
844
+ CloseMatViewIncrementalMaintenance (void )
845
+ {
846
+ matview_maintenance_depth -- ;
847
+ Assert (matview_maintenance_depth >= 0 );
848
+ }
You can’t perform that action at this time.
0 commit comments