Skip to content

Commit 4eeda92

Browse files
committed
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 918eee0. Per bug #8684 from Brett Neumeier.
1 parent d43760b commit 4eeda92

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/backend/utils/adt/rangetypes_typanalyze.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "catalog/pg_operator.h"
2828
#include "commands/vacuum.h"
2929
#include "utils/builtins.h"
30+
#include "utils/lsyscache.h"
3031
#include "utils/rangetypes.h"
3132

3233
static int float8_qsort_cmp(const void *a1, const void *a2);
@@ -44,8 +45,8 @@ range_typanalyze(PG_FUNCTION_ARGS)
4445
TypeCacheEntry *typcache;
4546
Form_pg_attribute attr = stats->attr;
4647

47-
/* Get information about range type */
48-
typcache = range_get_typcache(fcinfo, stats->attrtypid);
48+
/* Get information about range type; note column might be a domain */
49+
typcache = range_get_typcache(fcinfo, getBaseType(stats->attrtypid));
4950

5051
if (attr->attstattarget < 0)
5152
attr->attstattarget = default_statistics_target;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy