Chapter 45. Logical Decoding

Table of Contents

45.1. Logical Decoding Examples
45.2. Logical Decoding Concepts
45.2.1. Logical Decoding
45.2.2. Replication Slots
45.2.3. Output Plugins
45.2.4. Exported Snapshots
45.3. Streaming Replication Protocol Interface
45.4. Logical Decoding SQL Interface
45.5. System Catalogs Related to Logical Decoding
45.6. Logical Decoding Output Plugins
45.6.1. Initialization Function
45.6.2. Capabilities
45.6.3. Output Modes
45.6.4. Output Plugin Callbacks
45.6.5. Functions for Producing Output
45.7. Logical Decoding Output Writers
45.8. Synchronous Replication Support for Logical Decoding
45.8.1. Overview
45.8.2. Caveats

LightDB provides infrastructure to stream the modifications performed via SQL to external consumers. This functionality can be used for a variety of purposes, including replication solutions and auditing.

Changes are sent out in streams identified by logical replication slots.

The format in which those changes are streamed is determined by the output plugin used. An example plugin is provided in the LightDB distribution. Additional plugins can be written to extend the choice of available formats without modifying any core code. Every output plugin has access to each individual new row produced by INSERT and the new row version created by UPDATE. Availability of old row versions for UPDATE and DELETE depends on the configured replica identity (see REPLICA IDENTITY).

Changes can be consumed either using the streaming replication protocol (see Section 49.4 and Section 45.3), or by calling functions via SQL (see Section 45.4). It is also possible to write additional methods of consuming the output of a replication slot without modifying core code (see Section 45.7).

English|中文