Thread: Re: Allow pg_dump --statistics-only to dump foreign table statistics?

Re: Allow pg_dump --statistics-only to dump foreign table statistics?

From
Nathan Bossart
Date:
On Fri, Jun 13, 2025 at 04:19:26PM +0900, Fujii Masao wrote:
> I noticed that pg_restore_relation|attribute_stats() can restore statistics
> for foreign tables, but pg_dump --statistics-only doesn't include them.
> Is there a reason why pg_dump skips statistics for foreign tables?
> Are there any risks or concerns around including them?

Isn't this applicable to --with-statistics, too?

> Sorry if this has already been discussed. I tried searching but couldn't
> find the discussion. If there is one, I'd appreciate it if you could point
> me to it.

I skimmed through the main thread for the feature [0] (which seems to be so
long that it sometimes doesn't load completely), and I didn't see anything
directly related to the topic.  There was some discussion about importing
foreign relation stats with the new functions instead of remote table
samples, but that's a different thing.

[0] https://postgr.es/m/CADkLM%3DcB0rF3p_FuWRTMSV0983ihTRpsH%2BOCpNyiqE7Wk0vUWA%40mail.gmail.com

-- 
nathan