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

From jian he
Subject Re: BUG #19715: pg_restore_attribute_stats() rejects range statistics for a domain over int4multirange
Date
Msg-id CACJufxFpoeswdX3hV_vg+Tr78Q++01yk06k5Y4aPapYm_-hW3Q@mail.gmail.com
Whole thread
In response to Re: BUG #19715: pg_restore_attribute_stats() rejects range statistics for a domain over int4multirange  (Corey Huinker <corey.huinker@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 1:56 PM Corey Huinker <corey.huinker@gmail.com> wrote:
>
> Here's what I was just about to post to the list, only to see that you already posted something.
>
Hi.

I only took a brief look.
maybe related:
https://git.postgresql.org/cgit/postgresql.git/commit/?id=4edd6036d69ce42ac1af236f659f20daed65c8d4

src/backend/statistics/attribute_stats.c
I wonder in statatt_get_type, can we do:

typcache = lookup_type_cache(*atttypid, TYPECACHE_LT_OPR |
TYPECACHE_EQ_OPR  | TYPECACHE_DOMAIN_BASE_INFO);
if (OidIsValid(typcache->domainBaseType))
    *atttyptype = get_typtype(typcache->domainBaseType);
else
    *atttyptype = typcache->typtype;

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.



--
jian
https://www.enterprisedb.com/



pgsql-bugs by date:

Previous
From: Bharath Rupireddy
Date:
Subject: Re: autovacuum: automatically propagate updated parameters
Next
From: Daniel Gustafsson
Date:
Subject: Re: autovacuum: automatically propagate updated parameters