From 4e1ee79e3182256d9c8ddbc1ce9c4e8419c611ff Mon Sep 17 00:00:00 2001 From: Alexander Korotkov Date: Mon, 21 Dec 2020 00:26:13 +0300 Subject: [PATCH] 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. --- src/backend/utils/adt/rangetypes_typanalyze.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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++; } -- 2.30.2