postgres-drop-stale-replication-slot

Drop a replication slot that is pinning WAL and filling the disk, after confirming nothing is consuming it.

Procedure

  1. start start. Goes next to s1
  2. check Confirm the slot is inactive. Goes on_fail to s9; next to s2
  3. escalate Escalate to the database owner. Terminal
  4. action Drop the replication slot, DEL (destructive), requires approval. Goes rollback to s4; next to s3
  5. check Confirm WAL is releasing. Goes on_fail to s4; next to __end_success
  6. action Recreate the replication slot, RW (reversible-write). Goes next to __end_aborted
  7. end success. Terminal
  8. end aborted. Terminal

Open the graph on its own page — larger, printable, and an address you can send.

Walk it without running it — you answer what your environment would answer, and the path, the capabilities, the approvals and the distance back to an undo come out of the document. Nothing executes; there is no Run button here and there will not be one.

Trust

T2 · attested 2026-10-11 · runbooks.directory

Nobody has attested this record. That is the ordinary case: T2 is what the catalog can check on its own, and T3 needs somebody to run the procedure and sign for it.

  • Link liveness has not been checked: it needs a network and the catalog builds without one. Run pnpm gates --online where there is one.

Steps

  1. s1 check — Confirm the slot is inactive
  2. s2 action — Drop the replication slot (destructive) — requires approval
  3. s3 check — Confirm WAL is releasing
  4. s4 action — Recreate the replication slot (reversible-write)
  5. s9 escalate — Escalate to the database owner

Capabilities

This is a privilege request. Check it against your own allowlist before running.

  • cli:psql — used by s1, s2, s3, s4

Provenance

Source
https://runbooks.directory/r/std/postgres-drop-stale-replication-slot/source.md
Fetched
2026-09-02
Source last checked
not since it was captured on 2026-09-02 — recorded as current
Licence
CC-BY-4.0
How it got here
Written by this catalog's maintainers and reviewed in full.
Highest risk in this procedure
destructive

Take it with you

Run it under supervision

This procedure contains destructive steps. Run it here, where the supervisor is the thing invoking the commands and therefore sees every one of them: each step is proposed before it happens and a gate stops for you. Nothing about the run leaves this machine.

# destructive steps: every one stops for you before it runs.
npx @runbooks/cli run std/postgres-drop-stale-replication-slot@1.0.0 --as "$(whoami)" \
  --input slot=<replication slot name>