Commit 414cd434 authored by Alvaro Herrera's avatar Alvaro Herrera

Fix extstat collection when no stats are produced for a column

This is a mistakenly placed conditional in bf2a691e.

Reported by Justin Pryzby
Discussion: https://postgr.es/m/20171117214352.GE25796@telsasoft.com
parent cd482f29
...@@ -95,15 +95,16 @@ BuildRelationExtStatistics(Relation onerel, double totalrows, ...@@ -95,15 +95,16 @@ BuildRelationExtStatistics(Relation onerel, double totalrows,
*/ */
stats = lookup_var_attr_stats(onerel, stat->columns, stats = lookup_var_attr_stats(onerel, stat->columns,
natts, vacattrstats); natts, vacattrstats);
if (!stats && !IsAutoVacuumWorkerProcess()) if (!stats)
{ {
ereport(WARNING, if (!IsAutoVacuumWorkerProcess())
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION), ereport(WARNING,
errmsg("statistics object \"%s.%s\" could not be computed for relation \"%s.%s\"", (errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
stat->schema, stat->name, errmsg("statistics object \"%s.%s\" could not be computed for relation \"%s.%s\"",
get_namespace_name(onerel->rd_rel->relnamespace), stat->schema, stat->name,
RelationGetRelationName(onerel)), get_namespace_name(onerel->rd_rel->relnamespace),
errtable(onerel))); RelationGetRelationName(onerel)),
errtable(onerel)));
continue; continue;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment