Re: BUG #19715: pg_restore_attribute_stats() rejects range statistics for a domain over int4multirange - Mailing list pgsql-bugs

From Michael Paquier
Subject Re: BUG #19715: pg_restore_attribute_stats() rejects range statistics for a domain over int4multirange
Date
Msg-id arWpl7GpyleJ-HjT@paquier.xyz
Whole thread
In response to Re: BUG #19715: pg_restore_attribute_stats() rejects range statistics for a domain over int4multirange  (jian he <jian.universality@gmail.com>)
Responses Re: BUG #19715: pg_restore_attribute_stats() rejects range statistics for a domain over int4multirange
List 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

Attachment

pgsql-bugs by date:

Previous
From: Manu
Date:
Subject: Re: autovacuum: automatically propagate updated parameters
Next
From: Michael Paquier
Date:
Subject: Re: BUG #19715: pg_restore_attribute_stats() rejects range statistics for a domain over int4multirange