Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 414cd43

Browse files
committed
Fix extstat collection when no stats are produced for a column
This is a mistakenly placed conditional in bf2a691. Reported by Justin Pryzby Discussion: https://postgr.es/m/20171117214352.GE25796@telsasoft.com
1 parent cd482f2 commit 414cd43

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/backend/statistics/extended_stats.c

+9-8
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,16 @@ BuildRelationExtStatistics(Relation onerel, double totalrows,
9595
*/
9696
stats = lookup_var_attr_stats(onerel, stat->columns,
9797
natts, vacattrstats);
98-
if (!stats && !IsAutoVacuumWorkerProcess())
98+
if (!stats)
9999
{
100-
ereport(WARNING,
101-
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
102-
errmsg("statistics object \"%s.%s\" could not be computed for relation \"%s.%s\"",
103-
stat->schema, stat->name,
104-
get_namespace_name(onerel->rd_rel->relnamespace),
105-
RelationGetRelationName(onerel)),
106-
errtable(onerel)));
100+
if (!IsAutoVacuumWorkerProcess())
101+
ereport(WARNING,
102+
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
103+
errmsg("statistics object \"%s.%s\" could not be computed for relation \"%s.%s\"",
104+
stat->schema, stat->name,
105+
get_namespace_name(onerel->rd_rel->relnamespace),
106+
RelationGetRelationName(onerel)),
107+
errtable(onerel)));
107108
continue;
108109
}
109110

0 commit comments

Comments
 (0)