提交 4eeda92d 编写于 作者: T Tom Lane

Fix ANALYZE failure on a column that's a domain over a range.

Most other range operations seem to work all right on domains,
but this one not so much, at least not since commit 918eee0c.
Per bug #8684 from Brett Neumeier.
上级 d43760b6
......@@ -27,6 +27,7 @@
#include "catalog/pg_operator.h"
#include "commands/vacuum.h"
#include "utils/builtins.h"
#include "utils/lsyscache.h"
#include "utils/rangetypes.h"
static int float8_qsort_cmp(const void *a1, const void *a2);
......@@ -44,8 +45,8 @@ range_typanalyze(PG_FUNCTION_ARGS)
TypeCacheEntry *typcache;
Form_pg_attribute attr = stats->attr;
/* Get information about range type */
typcache = range_get_typcache(fcinfo, stats->attrtypid);
/* Get information about range type; note column might be a domain */
typcache = range_get_typcache(fcinfo, getBaseType(stats->attrtypid));
if (attr->attstattarget < 0)
attr->attstattarget = default_statistics_target;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册