Re: [PG19] pg_dump --statistics restores extended statistics by attribute number

From: shihao zhong <zhong950419(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Corey Huinker <corey(dot)huinker(at)gmail(dot)com>, tomas(at)vondra(dot)me
Subject: Re: [PG19] pg_dump --statistics restores extended statistics by attribute number
Date: 2026-10-13 04:56:17
Message-ID: CAGRkXqSxj-uO6g-x+hwcwWNi21Ry_BXLnb1C4zYU1UxyovCJOQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Michael,

Thanks for the quick reply and the pointer.

I agree 19 is not the place for a big change, so rejection works for me.

The dropped column case is rejected today, that is the warning in my
first mail. The child with another column order is not. Its numbers are
valid for the restored table, so the data lands on other columns.

v2 drops the mapping and only rejects that case. pg_dump passes the
column names of the statistics object, and the restore function skips
the data when they are not the names of its own columns in the same
order. The child then gets

WARNING: could not restore extended statistics object
"public.ch_s": its columns do not match "attnames"

Thanks,
Shihao

Attachment Content-Type Size
v2-0003-Test-attnames-in-pg_restore_extended_stats.patch application/octet-stream 5.8 KB
v2-0002-pg_dump-pass-column-names-with-extended-statistic.patch application/octet-stream 2.7 KB
v2-0001-Let-pg_restore_extended_stats-check-the-column-na.patch application/octet-stream 4.0 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexandre Felipe 2026-10-13 05:02:15 Re: Restructured Shared Buffer Hash Table
Previous Message Michael Paquier 2026-10-13 04:53:53 Re: pgstat: allow a stats kind to use its own dedicated dsa/dshash