Re: pg_restore handles extended statistics inconsistently with statistics data

Corey Huinker <corey.huinker@gmail.com>

From: Corey Huinker <corey.huinker@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Chao Li <li.evan.chao@gmail.com>, PostgreSQL-development <pgsql-hackers@lists.postgresql.org>, Michael Paquier <michael.paquier@gmail.com>, Jeff Davis <pgsql@j-davis.com>
Date: 2026-06-16T02:53:22Z
Lists: pgsql-hackers
>
> The reasoning is that a stats
> object may live on a different schema than the table it is defined on,
> so you cannot guarantee that its schema has been created if you only
> create a table on a schema.


Solid reasoning, though unfortunate.

Commits

  1. pg_restore: Use dependency-based matching for STATISTICS DATA

  2. Fix inconsistencies with pg_restore --statistics[-only]