| From: | Corey Huinker <corey(dot)huinker(at)gmail(dot)com> |
|---|---|
| To: | Artem Gavrilov <artem(dot)gavrilov(at)percona(dot)com> |
| Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: [PG19] pg_dump marks extended statistics of pre-v15 partitioned tables as non-inherited |
| Date: | 2026-11-06 22:11:07 |
| Message-ID: | CADkLM=dfh6z_GM0hejxs6ycFND0r2zQc8pN6=4WRyM-ngdMrQg@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Thu, Oct 22, 2026 at 11:12 AM Artem Gavrilov <artem(dot)gavrilov(at)percona(dot)com>
wrote:
> Hello hackers,
>
> Since c32fb29e979, pg_dump --statistics dumps extended statistics
> data. For servers older than v15, where pg_stats_ext has no inherited
> column, the query hard-codes the flag to false. The commit message
> says "In v14 and older versions, inherited extended statistics are not
> supported". That is true for the catalog, but not for the data: since
> 20b9fa308eb, back-patched down to 10.20, 11.15, 12.10, 13.6 and 14.2,
> these versions build inherited extended stats on partitioned tables.
>
That's an odd one, indeed.
> The attached patch deduces the inherited flag from the relkind of the
> table for pre-v15 servers, the same way 20b9fa308eb chooses which data
> to build: true for partitioned tables, false for all other relations.
> pg_dump already has the relkind in TableInfo, so I did it in C rather
> than in the SQL query. The patch applies to master (5ffb8c74093) and
> REL_19_STABLE (2dc899f780f).
>
My inclination was also to handle it in SQL but there isn't an elegant way
to do that, so the C route is definitely better.
I've also confirmed that it applies to master (d073ddd5180) and
REL_19_STABLE. It passes tests, but it isn't really exercised by the
regular test suite, so we'll have to rely on the buildfarm and even then
I'm not sure there will be coverage.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Zsolt Parragi | 2026-11-06 22:17:38 | Re: Use correct collation in pg_trgm |
| Previous Message | Zsolt Parragi | 2026-11-06 22:07:21 | Re: Draft back-branch release notes are up |