On 2020-Jun-30, Fujii Masao wrote: > Sorry this is not true. That distance can be calculated without those > operators. > For example, > > SELECT restart_lsn - pg_current_wal_lsn() + (SELECT setting::numeric * 1024 * > 1024 FROM pg_settings WHERE name = 'max_slot_wal_keep_size') distance FROM > pg_replication_slots; > > If the calculated distance is small or negative value, which means that > we may lose some required WAL files. So in this case it's worth considering > to increase max_slot_wal_keep_size.
... OK, but you're forgetting wal_keep_segments. > I still think it's better and more helpful to display something like > that distance in pg_replication_slots rather than making each user > calculate it... Agreed. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services