PostgreSQL & Databases
Replication slots
A replication slot makes the primary keep WAL until a consumer has received it. You learn how an inactive slot fills the disk, and how to measure it and drop it safely.
What you will be able to do
- Explain what a replication slot guarantees to a standby, and what it costs.
- Decide when to drop a slot, or cap the WAL it may retain.
What is in the lesson
- A real situation where this goes wrong
- How it works, step by step
- A walkthrough with commands you can run
- How it fails in production, and how to tell
- Three quiz questions with explanations
Read this lessonFree. No account needed.
More in PostgreSQL & Databases
- Planner statisticsAdvanced · 4 min
Planner statistics are sampled estimates that ANALYZE stores per column, and the planner uses them to pick plans. You learn to compare estimates with real counts and to…
- WAL fundamentalsAdvanced · 4 min
WAL records each change before the data page is written, so a crash is repaired by replaying the log. You learn why a commit waits for the log flush, and why fsync must…
- Streaming replicasAdvanced · 4 min
A streaming replica replays WAL from the primary and can serve read-only queries, but it trails the primary and can cancel queries. You learn to check lag and conflicts…
- PITR with pgBackRestAdvanced · 5 min
Point-in-time recovery rebuilds a database to a chosen moment from a base backup and archived WAL. A restore is only as good as the archive that covers the target time.
- PgBouncer transaction poolingAdvanced · 5 min
PgBouncer transaction pooling lends a server connection for one transaction at a time. Session state set outside a transaction can leak to other clients, so the…
- Partition pruningAdvanced · 4 min
Partition pruning lets the planner skip child tables whose bounds cannot match a query's WHERE clause. The filter must compare the partition key directly, or the…