mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-12 18:34:36 +08:00
Fix extstat collection when no stats are produced for a column
This is a mistakenly placed conditional in bf2a691e02
.
Reported by Justin Pryzby
Discussion: https://postgr.es/m/20171117214352.GE25796@telsasoft.com
This commit is contained in:
parent
cd482f2951
commit
414cd434ff
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user