Skip to content

Add add_tables and filter_tables wal2json plugin options#791

Open
blakewatters wants to merge 1 commit intoxataio:mainfrom
blakewatters:add-wal-filtering-support
Open

Add add_tables and filter_tables wal2json plugin options#791
blakewatters wants to merge 1 commit intoxataio:mainfrom
blakewatters:add-wal-filtering-support

Conversation

@blakewatters
Copy link
Copy Markdown

Allows passing wal2json's add-tables and filter-tables options via pgstream config (YAML and env vars). These filter at the source-side decode level, preventing wal2json from generating JSON for excluded tables — dramatically reducing CPU and network overhead.

Config:
source.postgres.replication.plugin.add_tables: "public."
source.postgres.replication.plugin.filter_tables: "pipelines.
,private.*"

Env vars:
PGSTREAM_POSTGRES_REPLICATION_PLUGIN_ADD_TABLES
PGSTREAM_POSTGRES_REPLICATION_PLUGIN_FILTER_TABLES

Description

Please provide a brief description of the changes in this PR.

Related Issue(s)
  • Fixes #(issue number)
  • Closes #(issue number)
  • Related to #(issue number)

Type of Change

Please select the relevant option(s):

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔧 Refactoring (no functional changes)
  • ⚡ Performance improvement
  • 🧪 Test coverage improvement
  • 🔨 Build/CI changes
  • 🧹 Code cleanup

Changes Made

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • All existing tests pass

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Code is well-commented
  • Documentation updated where necessary

Additional Notes

Allows passing wal2json's add-tables and filter-tables options via
pgstream config (YAML and env vars). These filter at the source-side
decode level, preventing wal2json from generating JSON for excluded
tables — dramatically reducing CPU and network overhead.

Config:
  source.postgres.replication.plugin.add_tables: "public.*"
  source.postgres.replication.plugin.filter_tables: "pipelines.*,private.*"

Env vars:
  PGSTREAM_POSTGRES_REPLICATION_PLUGIN_ADD_TABLES
  PGSTREAM_POSTGRES_REPLICATION_PLUGIN_FILTER_TABLES
@kvch
Copy link
Copy Markdown
Collaborator

kvch commented Apr 13, 2026

Thank you for your contribution! The changes look good. Do you mind adding the two new options to the example configration? https://github.com/xataio/pgstream/blob/main/docs/configuration.md

@kvch
Copy link
Copy Markdown
Collaborator

kvch commented Apr 13, 2026

The coverage job failure is because the branch is pushed to a fork, not to this repo. It can be ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants