An inactive slot can still hold WAL
Create standby1, inspect it before use, attach the base backup with -S standby1, then stop the standby. The slot stays behind on the primary.
Before a default physical slot's first use, restart_lsn can be NULL: it has not yet reserved a position. After use, active = f describes disconnection, while restart_lsn describes the oldest required WAL, not the last visible row.
The offline workload and pg_switch_wal() create a positive current-to-restart distance. This is a WAL address distance, not an exact byte total of directory files. Check the named slot is absent after dropping it; a checkpoint can then recycle unneeded segments, subject to other retention requirements. File count need not shrink immediately.
Reference-only: wal_keep_size is a minimum amount of old WAL to retain, not a maximum disk budget. max_slot_wal_keep_size can limit slot retention and invalidate an overrun slot. A slot does not promise unlimited safety under every configured policy.
Did you know? A seat reservation and an occupied seat are different: similarly, an inactive slot can still reserve WAL. Read the reservation boundary, not only active. Replication-slot view.
Key concepts
Physical Replication Slot
A persistent physical slot tracks required WAL through restart_lsn. It can retain WAL while inactive. The default non-reserving creation call has no position until first use. Configured limits can invalidate a slot; its existence is not unlimited protection.
restart_lsn
restart_lsn is the oldest WAL required by the slot, not an exact latest replay location. After the lab standby disconnects it retains this boundary. Compare it with the current LSN for byte distance, and inspect retention policies for actual safety.