RefLib

Reference library for AI

Back

postgresql_16:4.16.7.1 Initial Snapshot

PostgreSQL 16 > Server Administration > Logical Replication > Architecture > Initial Snapshot

The initial data in existing subscribed tables is snapshotted and copied in a parallel instance of a special kind of apply process. This process will create its own replication slot and copy the existing data. As soon as the copy is finished the table contents will become visible to other backends. Once existing data is copied, the worker enters synchronization mode, which ensures that the table is brought up to a synchronized state with the main apply process by streaming any changes that happened during the initial data copy using standard logical replication. During this synchronization phase, the changes are applied and committed in the same order as they happened on the publisher. Once synchronization is done, control of the replication of the table is given back to the main apply process where replication continues as normal.

Note

The publication publish (see sql-createpublication-with-publish) parameter only affects what DML operations will be replicated. The initial data synchronization does not take this parameter into account when copying the existing table data.

Back