From: Alexander Korotkov Date: Sun, 20 Dec 2020 21:26:13 +0000 (+0300) Subject: Fix typalign in rangetypes statistics X-Git-Tag: REL_14_BETA1~1105 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=4e1ee79e3182256d9c8ddbc1ce9c4e8419c611ff;p=postgresql.git Fix typalign in rangetypes statistics 6df7a9698b introduces multirange types, whose typanalyze function shares infrastructure with range types typanalyze function. Since 6df7a9698b, information about type gathered by statistics is filled from typcache. But typalign is mistakenly always set to double. This commit fixes this oversight. --- diff --git a/src/backend/utils/adt/rangetypes_typanalyze.c b/src/backend/utils/adt/rangetypes_typanalyze.c index 1376cf06940..d5fa36b6ff0 100644 --- a/src/backend/utils/adt/rangetypes_typanalyze.c +++ b/src/backend/utils/adt/rangetypes_typanalyze.c @@ -330,7 +330,7 @@ compute_range_stats(VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfunc, stats->statypid[slot_idx] = typcache->type_id; stats->statyplen[slot_idx] = typcache->typlen; stats->statypbyval[slot_idx] = typcache->typbyval; - stats->statypalign[slot_idx] = 'd'; + stats->statypalign[slot_idx] = typcache->typalign; slot_idx++; }