We are able to reset the stats of pg_attibute without your patch.
Thanks,
Himanshu
On Fri, Aug 6, 2021 at 1:56 PM Sadhuprasad Patro <b.sadhu@gmail.com> wrote:
Hi,
The call to “pg_stat_reset“ does reset all the statistics data for tables belonging to the current database but does not take care of shared tables e.g pg_attribute. Similarly to reset the statistics at table level, the call to “pg_stat_reset_single_table_counters“ does not take care of shared tables.
When we reset all the statistics using the call “pg_stat_reset”, the postgres process internally makes calls to “ pgstat_recv_resetcounter“, which resets the statistics of all the tables of the current database. But not resetting the statistics of shared objects using database ID as 'InvalidOid'.
The same fix is made in the internal function “pgstat_recv_resetsinglecounter“ to reset the statistics for the shared table for the call "pg_stat_reset_single_table_counters".