On Mon, Jun 16, 2025 at 03:39:07PM -0400, Corey Huinker wrote: > If we aren't exporting stats for foreign tables then that is an oversight, > the intention always was to fetch all available statistics for all > relations. I can't offhand think of where we even have the option to > exclude them.
getRelationStatistics() enumerates the relation kinds: if ((relkind == RELKIND_RELATION) || (relkind == RELKIND_PARTITIONED_TABLE) || (relkind == RELKIND_INDEX) || (relkind == RELKIND_PARTITIONED_INDEX) || (relkind == RELKIND_MATVIEW)) The proposed patch [0] adds RELKIND_FOREIGN_TABLE to this list. That appears to be the only missing relation kind that ANALYZE handles. [0] https://postgr.es/m/attachment/177608/v1-0001-pg_dump-Allow-pg_dump-to-dump-the-statistics-for-.patch -- nathan