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

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, 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 06:44:19
Message-ID: CACJufxFpoeswdX3hV_vg+Tr78Q++01yk06k5Y4aPapYm_-hW3Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Sep 24, 2026 at 1:56 PM Corey Huinker <corey(dot)huinker(at)gmail(dot)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/

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Daniel Gustafsson 2026-09-24 09:04:35 Re: autovacuum: automatically propagate updated parameters
Previous Message Bharath Rupireddy 2026-09-24 06:34:58 Re: autovacuum: automatically propagate updated parameters