decoderbufs

Logical decoding plugin that delivers WAL stream changes using a Protocol Buffer format

Overview

PackageVersionCategoryLicenseLanguage
decoderbufs3.6.0ETLMITC
IDExtensionBinLibLoadCreateTrustRelocSchema
9650decoderbufsNoYesYesNoNoNo-
Relatedpglogical wal2json decoder_raw test_decoding kafka_fdw pglogical_origin pglogical_ticker pg_failover_slots

Version

TypeRepoVersionPG VerPackageDeps
EXTPGDG3.6.01817161514decoderbufs-
RPMPGDG3.5.01817161514postgres-decoderbufs_$v-
DEBPGDG3.6.01817161514postgresql-$v-decoderbufs-
OS / PGPG18PG17PG16PG15PG14
el8.x86_64
el8.aarch64
el9.x86_64
el9.aarch64
el10.x86_64
el10.aarch64
d12.x86_64
d12.aarch64
d13.x86_64
d13.aarch64
u22.x86_64
u22.aarch64
u24.x86_64
u24.aarch64
u26.x86_64
u26.aarch64

Install

You can install decoderbufs directly. First, make sure the PGDG repository is added and enabled:

pig repo add pgdg -u          # Add PGDG repo and update cache

Install the extension using pig or apt/yum/dnf:

pig install decoderbufs;          # Install for current active PG version
pig ext install -y decoderbufs -v 18  # PG 18
pig ext install -y decoderbufs -v 17  # PG 17
pig ext install -y decoderbufs -v 16  # PG 16
pig ext install -y decoderbufs -v 15  # PG 15
pig ext install -y decoderbufs -v 14  # PG 14
dnf install -y postgres-decoderbufs_18       # PG 18
dnf install -y postgres-decoderbufs_17       # PG 17
dnf install -y postgres-decoderbufs_16       # PG 16
dnf install -y postgres-decoderbufs_15       # PG 15
dnf install -y postgres-decoderbufs_14       # PG 14
apt install -y postgresql-18-decoderbufs   # PG 18
apt install -y postgresql-17-decoderbufs   # PG 17
apt install -y postgresql-16-decoderbufs   # PG 16
apt install -y postgresql-15-decoderbufs   # PG 15
apt install -y postgresql-14-decoderbufs   # PG 14

Preload:

shared_preload_libraries = 'decoderbufs';

Usage

Sources:

decoderbufs is a headless PostgreSQL logical-decoding output plugin used by the Debezium PostgreSQL connector. It turns WAL changes into Protocol Buffers messages; it does not create a user SQL schema and does not require CREATE EXTENSION.

Configure PostgreSQL

Enable the plugin and logical replication in postgresql.conf, size the sender and slot limits for the expected consumers, then restart PostgreSQL:

shared_preload_libraries = 'decoderbufs'
wal_level = logical
max_wal_senders = 8
max_replication_slots = 4

The replication login also needs the REPLICATION attribute and a matching pg_hba.conf rule. Use authentication appropriate for the network rather than the README’s local demonstration settings.

Core Workflow

Create a logical slot whose output plugin is decoderbufs:

SELECT *
FROM pg_create_logical_replication_slot('decoderbufs_demo', 'decoderbufs');

For inspection in psql, ask the plugin for debug text:

SELECT data
FROM pg_logical_slot_peek_changes(
  'decoderbufs_demo', NULL, NULL, 'debug-mode', '1'
);

SELECT data
FROM pg_logical_slot_get_changes(
  'decoderbufs_demo', NULL, NULL, 'debug-mode', '1'
);

peek leaves the confirmed position unchanged; get advances it. Normal Debezium operation consumes the binary messages defined by pg_logicaldec.proto rather than enabling debug mode.

Important Objects and Boundaries

  • decoderbufs is the logical-decoding output-plugin name passed when a slot is created.
  • debug-mode = 1 provides human-readable output for troubleshooting only.
  • The Protobuf message carries transaction metadata, relation and column information, operation kind, old keys, and typed values.
  • Tables that must emit sufficient data for UPDATE and DELETE require an appropriate REPLICA IDENTITY.

Logical slots retain WAL until a consumer confirms progress. Monitor pg_replication_slots and remove abandoned slots deliberately to prevent disk exhaustion. Schema changes, replica identity, unsupported data-type mappings, and large transactions should be tested with the matching Debezium connector version.

The upstream build requires PostgreSQL 9.6 or newer and protobuf-c; PostGIS support is compiled when available. The package release moves with Debezium to 3.6.0.Final, while the plugin control metadata remains SQL version 0.1.0 because this is an output plugin rather than a migration-based SQL extension.


Last Modified 2026-07-23: update extension list to 555 (d81fc56)