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.
This commit is contained in:
Kevin Grittner 2013-08-01 14:31:09 -05:00
parent 149e38e5ee
commit f31c149f13

View File

@ -816,6 +816,24 @@ refresh_by_heap_swap(Oid matviewOid, Oid OIDNewHeap)
RelationCacheInvalidateEntry(matviewOid);
}
/*
* This should be used to test whether the backend is in a context where it is
* OK to allow DML statements to modify materialized views. We only want to
* allow that for internal code driven by the materialized view definition,
* not for arbitrary user-supplied code.
*
* While the function names reflect the fact that their main intended use is
* incremental maintenance of materialized views (in response to changes to
* the data in referenced relations), they are initially used to allow REFRESH
* without blocking concurrent reads.
*/
bool
MatViewIncrementalMaintenanceIsEnabled(void)
{
return matview_maintenance_depth > 0;
}
static void
OpenMatViewIncrementalMaintenance(void)
{
@ -828,15 +846,3 @@ CloseMatViewIncrementalMaintenance(void)
matview_maintenance_depth--;
Assert(matview_maintenance_depth >= 0);
}
/*
* This should be used to test whether the backend is in a context where it is
* OK to allow DML statements to modify materialized views. We only want to
* allow that for internal code driven by the materialized view definition,
* not for arbitrary user-supplied code.
*/
bool
MatViewIncrementalMaintenanceIsEnabled(void)
{
return matview_maintenance_depth > 0;
}