RefLib

Reference library for AI

Back

postgresql_16:6.12.2.4 Exported Snapshots

PostgreSQL 16 > Server Programming > Logical Decoding > Logical Decoding Concepts > Exported Snapshots

When a new replication slot is created using the streaming replication interface (see (see protocol-replication-create-replication-slot)), a snapshot is exported (see (see postgresql_16:3.6.27.5)), which will show exactly the state of the database after which all changes will be included in the change stream. This can be used to create a new replica by using SET TRANSACTION SNAPSHOT (see postgresql_16:7.1.176) to read the state of the database at the moment the slot was created. This transaction can then be used to dump the database's state at that point in time, which afterwards can be updated using the slot's contents without losing any changes.

Applications that do not require snapshot export may suppress it with the SNAPSHOT 'nothing' option.

Back