diff options
author | Kevin Grittner <kgrittn@postgresql.org> | 2013-08-01 14:31:09 -0500 |
---|---|---|
committer | Kevin Grittner <kgrittn@postgresql.org> | 2013-08-01 14:31:09 -0500 |
commit | f31c149f13e4495051e014bab6fbe5e8ec4f56f1 (patch) | |
tree | 86ce1a18eef8d220c8cb0f996b8d2423f18721a6 /src/backend/commands/matview.c | |
parent | 149e38e5ee02731d505946ced0f7bfc547c0e374 (diff) | |
download | postgresql-f31c149f13e4495051e014bab6fbe5e8ec4f56f1.tar.gz postgresql-f31c149f13e4495051e014bab6fbe5e8ec4f56f1.zip |
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.
Diffstat (limited to 'src/backend/commands/matview.c')
-rw-r--r-- | src/backend/commands/matview.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/src/backend/commands/matview.c b/src/backend/commands/matview.c index 09ea344256a..3c547a9b86c 100644 --- a/src/backend/commands/matview.c +++ b/src/backend/commands/matview.c @@ -816,27 +816,33 @@ refresh_by_heap_swap(Oid matviewOid, Oid OIDNewHeap) RelationCacheInvalidateEntry(matviewOid); } -static void -OpenMatViewIncrementalMaintenance(void) -{ - matview_maintenance_depth++; -} - -static void -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. + * + * 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) +{ + matview_maintenance_depth++; +} + +static void +CloseMatViewIncrementalMaintenance(void) +{ + matview_maintenance_depth--; + Assert(matview_maintenance_depth >= 0); +} |