Re: BUG #19715: pg_restore_attribute_stats() rejects range statistics for a domain over int4multirange

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: jian he <jian(dot)universality(at)gmail(dot)com>
Cc: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>, imchifan(at)163(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19715: pg_restore_attribute_stats() rejects range statistics for a domain over int4multirange
Date: 2026-09-24 22:52:07
Message-ID: arWpl7GpyleJ-HjT@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Sep 24, 2026 at 02:44:19PM +0800, jian he wrote:
> Similar in import_pg_statistic.
> change to
> typcache = lookup_type_cache(typid, TYPECACHE_LT_OPR |
> TYPECACHE_EQ_OPR | TYPECACHE_DOMAIN_BASE_INFO);
>
> Disclaimer: Since I saw both of you actively working on this issue, I
> haven't tried this myself.

Yes, I was wondering about that a bit, feeding a single typcache entry
across the board. And while looking at the code, I was reminded about
the following exceptions:
extended_stats_funcs.c: if (typid == TSVECTOROID)
stat_utils.c: if (*atttypid == TSVECTOROID)
stat_utils.c: if (atttypid == TSVECTOROID)

I think that the existing code is also broken when defining a domain
over tsvector if we don't feed a domain base type in these three
spots.
--
Michael

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2026-09-24 23:46:23 Re: BUG #19715: pg_restore_attribute_stats() rejects range statistics for a domain over int4multirange
Previous Message Manu 2026-09-24 21:35:36 Re: autovacuum: automatically propagate updated parameters