On Sat, Jun 8, 2019 at 9:26 AM Andres Freund <and...@anarazel.de> wrote: > > > A more aggressive approach would be to teach vac_update_datfrozenxid() > to ignore orphaned temp tables - perhaps even by heap_inplace'ing an > orphaned table's relfrozenxid/relminmxid with InvalidTransactionId. We'd > not want to do that in do_autovacuum() - otherwise the schema won't get > cleaned up, but for database widevacuums that seems like it could be > good approach. >
FWIW I like this approach. We don't need to calculate new datfrozenxid while including orphaned temp tables. It both improves behavior and fixes this issue. Also with that approach we will not need stop database cluster and do vacuuming in single user mode. The making the vacuum command cleanup orphaned temp tables would be helpful in the case where we reached to wraparound while having active temp tables, it doesn't happen in normal use case though. Regards, -- Masahiko Sawada NIPPON TELEGRAPH AND TELEPHONE CORPORATION NTT Open Source Software Center