Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f31c149

Browse files
committed
Improve comments for IncrementalMaintenance DML enabling functions.
Move the static functions after the comment and expand the comment. Per complaint from Andres Freund, although using different comment text.
1 parent 149e38e commit f31c149

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

src/backend/commands/matview.c

+18-12
Original file line numberDiff line numberDiff line change
@@ -816,27 +816,33 @@ refresh_by_heap_swap(Oid matviewOid, Oid OIDNewHeap)
816816
RelationCacheInvalidateEntry(matviewOid);
817817
}
818818

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-
}
831819

832820
/*
833821
* This should be used to test whether the backend is in a context where it is
834822
* OK to allow DML statements to modify materialized views. We only want to
835823
* allow that for internal code driven by the materialized view definition,
836824
* 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.
837830
*/
838831
bool
839832
MatViewIncrementalMaintenanceIsEnabled(void)
840833
{
841834
return matview_maintenance_depth > 0;
842835
}
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+
}

0 commit comments

Comments
 (0)