replication slot
A PostgreSQL object that remembers how far a consumer of the change stream has read, so no changes are lost between reads.
An unused slot keeps every write-ahead log file forever and can fill the database disk.
In more detail
The database keeps write-ahead log files until every slot has read past them, so a slot survives restarts. An abandoned slot therefore makes the log grow until the disk fills.
Example
SELECT * FROM pg_create_logical_replication_slot('m06l03_slot', 'test_decoding')Related terms
- logical decoding — The PostgreSQL feature that turns write-ahead log entries into readable row changes, such as inserts and updates with their values.
- write-ahead log — The log where PostgreSQL records every change before applying it to the data files, so it can recover after a crash.
- change data capture — Reading every insert, update and delete from a database's own change log and turning them into a stream of events.
Taught in
- Change Data Capture In Principle — Apache Kafka & Event Streaming