Emit msg re skipping ANALYZE for absent inh tree
authorSimon Riggs <simon@2ndQuadrant.com>
Sat, 15 Nov 2014 22:49:54 +0000 (22:49 +0000)
committerSimon Riggs <simon@2ndQuadrant.com>
Sat, 15 Nov 2014 22:49:54 +0000 (22:49 +0000)
When checking a table that has an inheritance tree marked,
if no child tables remain, we skip ANALYZE. This patch emits
a message to show that the action has been skipped.

Author: Etsuro Fujita
Reviewer: Furuya Osamu

src/backend/commands/analyze.c

index 954e5a68b6bd088e6db71aa2d14459a0b3c1f40b..732ab228cc6f84336aacbc9a49c716f6c0abe3f9 100644 (file)
@@ -1483,6 +1483,10 @@ acquire_inherited_sample_rows(Relation onerel, int elevel,
        /* CCI because we already updated the pg_class row in this command */
        CommandCounterIncrement();
        SetRelationHasSubclass(RelationGetRelid(onerel), false);
+       ereport(elevel,
+               (errmsg("skipping analyze of \"%s.%s\" inheritance tree --- this inheritance tree contains no child tables",
+                       get_namespace_name(RelationGetNamespace(onerel)),
+                       RelationGetRelationName(onerel))));
        return 0;
    }