wal2json
Changing data capture in JSON format
wal2json : Changing data capture in JSON format
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 9630 | wal2json | wal2json | 2.7 |
ETL | BSD-3-Clause | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s---- | No | Yes | No | No | no | no |
| Relationships | |
|---|---|
| See Also | decoderbufs pgoutput test_decoding pgmqtt pgq kafka_fdw wal2mongo decoder_raw pg_walinspect pg_logicalinspect |
Headless logical-decoding plugin; no CREATE EXTENSION/preload. PGDG 2.7 on D/U/most EL; EL10 aarch64 remains 2.6; use output_plugin_libraries.
Packages
| Linux / PG | PG19 | PG18 | PG17 | PG16 | PG15 |
|---|---|---|---|---|---|
| el8.x86_64 | N/A | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 |
| el8.aarch64 | N/A | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 |
| el9.x86_64 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 |
| el9.aarch64 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 |
| el10.x86_64 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 |
| el10.aarch64 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 |
| d12.x86_64 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 |
| d12.aarch64 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 |
| d13.x86_64 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 |
| d13.aarch64 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 |
| u22.x86_64 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 |
| u22.aarch64 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 |
| u24.x86_64 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 |
| u24.aarch64 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 |
| u26.x86_64 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 |
| u26.aarch64 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 | PGDG 2.7 |
Source
github.com/eulerto/wal2json
Install
Make sure PGDG repo available:
Install this extension with pig:
This extension does not need CREATE EXTENSION DDL command
Usage
Sources:
wal2json 2.7 is a logical decoding output plugin that produces JSON-formatted change data capture from the PostgreSQL WAL. It supports current PostgreSQL 18 and 19 development lines and is loaded as an output plugin, so it does not use CREATE EXTENSION or shared_preload_libraries.
For PostgreSQL 18.6, 17.11, 16.15, 15.19, 14.24 and later minor releases affected by CVE-2026-6471, add wal2json to output_plugin_libraries as documented by the upstream release notes.
Configuration
In postgresql.conf:
Using with Streaming Protocol (pg_recvlogical)
Using with SQL Functions
Output Format v1 (JSON per transaction)
Output Format v2 (JSON per tuple)
Enable with: 'format-version', '2'
Key Parameters
include-xids- add transaction ID (default: false)include-timestamp- add timestamp (default: false)include-schemas- add schema name (default: true)include-types- add column types (default: true)include-pk- add primary key info (default: false)include-lsn- add WAL LSN (default: false)include-not-null- add NOT NULL info (default: false)include-default- add default expressions (default: false)pretty-print- format JSON output (default: false)filter-tables- comma-separated list of tables to includeadd-tables- same as filter-tablesfilter-msg-prefixes- filter logical messages by prefixformat-version- 1 (per-transaction) or 2 (per-tuple)actions- filter by action type: insert, update, delete, truncate