aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2017-11-28 23:25:47 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2017-11-28 23:42:42 -0300
commitd4607590b6d8431906163280704e4023c625670c (patch)
treeb7a94d1ab9bcf90c935ae125a70154a050a4b912
parentdba6e75c1113dbfc7b10d93cc6c0babd8b7d852b (diff)
downloadpostgresql-d4607590b6d8431906163280704e4023c625670c.tar.gz
postgresql-d4607590b6d8431906163280704e4023c625670c.zip
Fix extstat collection when no stats are produced for a column
This is a mistakenly placed conditional in bf2a691e02d7. Reported by Justin Pryzby Discussion: https://postgr.es/m/20171117214352.GE25796@telsasoft.com
-rw-r--r--src/backend/statistics/extended_stats.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/backend/statistics/extended_stats.c b/src/backend/statistics/extended_stats.c
index db4987bde38..eeed56ff0aa 100644
--- a/src/backend/statistics/extended_stats.c
+++ b/src/backend/statistics/extended_stats.c
@@ -95,15 +95,16 @@ BuildRelationExtStatistics(Relation onerel, double totalrows,
*/
stats = lookup_var_attr_stats(onerel, stat->columns,
natts, vacattrstats);
- if (!stats && !IsAutoVacuumWorkerProcess())
+ if (!stats)
{
- ereport(WARNING,
- (errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
- errmsg("statistics object \"%s.%s\" could not be computed for relation \"%s.%s\"",
- stat->schema, stat->name,
- get_namespace_name(onerel->rd_rel->relnamespace),
- RelationGetRelationName(onerel)),
- errtable(onerel)));
+ if (!IsAutoVacuumWorkerProcess())
+ ereport(WARNING,
+ (errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
+ errmsg("statistics object \"%s.%s\" could not be computed for relation \"%s.%s\"",
+ stat->schema, stat->name,
+ get_namespace_name(onerel->rd_rel->relnamespace),
+ RelationGetRelationName(onerel)),
+ errtable(onerel)));
continue;
}