3 ms·
> Postgres is VERY committed to making sure a replication slot’s consumer doesn’t miss any data. This means that if a consumer stops consuming data from the slo
by anarazel 3y ago
> Postgres is VERY committed to making sure a replication slot’s consumer doesn’t miss any data. This means that if a consumer stops consuming data from the slot, Postgres will helpfully store all that missed data… right up until the disk fills up and the database falls over.
You can configure a size limit after which the slot gets marked as invalid, instead of continuing to retain space. See
https://www.postgresql.org/docs/current/runtime-config-replication.html#GUC-MAX-SLOT-WAL-KEEP-SIZE https://www.postgresql.org/docs/current/runtime-config-repli...
What other behaviour would you like?
> The other reason I don’t use it: the code path to get the initial snapshot of a table is totally different from the code path to read changes.
Hm. For anything dealing with larger data volumes you IME want to handle those things differently (so you can initialize in parallel, initialize from physical backups and similar things). But I can see why it could be useful to optionally stream out existing data out data after slot creation.
> Initializing the read from the replication slot so you never miss any changes is nontrivial.
That part shouldn't be hard - what gave you difficulty?