I think Horiguchi-san's approach is closer to what we would want.
Great.
Unfortunately, the reset time for other variable-numbered stats entries historically has behaved differently than what you're desiring. E.g. pg_stat_replication_slots.stats_reset isn't set unless you have reset the stats.
Conceptually, that's correct. But the Impact on users are different.
SQL statements around pg_stat_database are something every user (DBA) has in their arsenal for essential checks and troubleshooting.
The impact is big when their queries stopped working/giving wrong results from PostgeSQL 15 onwards.
I'm ok with changing the semantics to one behaviour,
Great. I believe everyone will appreciate a consistent behaviour
but I'm a bit hesitant whacking this around further in a minor release...
Since this sudden undocumented behaviour change caught everyone by surprise,
and case this is a too big change for a "bug-fix", is it possible to have a temporary fix for a minor version, fixing pg_stat_database alone?