logical-replication

Analyze and debug PostgreSQL logical replication subsystems including WAL decoding and apply workers.

Updated Jun 1, 2026
One-click install
npx skills add https://github.com/matejformanek/postgres-claude --skill logical-replication
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: logical-replication
Source: https://github.com/matejformanek/postgres-claude/tree/main/.claude/skills/logical-replication
Command: npx skills add https://github.com/matejformanek/postgres-claude --skill logical-replication

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill resolves the complexity of managing PostgreSQL logical replication, preventing common pitfalls like catalog_xmin retention, slot mismanagement, and apply-worker failures.

Core Features & Use Cases

  • Internals Navigation: Provides deep-dive guidance on publisher-side WAL decoding and subscriber-side apply-worker logic.
  • Troubleshooting: Offers authoritative checklists for debugging replication slot stalls, conflict resolution, and parallel apply issues.
  • Use Case: When a logical replication slot stops advancing and threatens to bloat the database, use this skill to identify the bottleneck in the reorder buffer or apply worker.

Quick Start

Use the logical-replication skill to diagnose why the replication slot is not advancing on the publisher.

Frequently Asked Questions about logical-replication

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How does PostgreSQL logical replication handle WAL decoding on the publisher side?

PostgreSQL logical replication uses WAL decoding to translate write-ahead log entries into a logical change stream. The reorder buffer processes these transactions before output plugins format and send them to subscribers.

Why is my PostgreSQL logical replication slot not advancing and causing database bloat?

A logical replication slot stalls when the subscriber apply worker fails to acknowledge transactions, preventing catalog_xmin advancement. Check the reorder buffer and apply worker logic to identify the bottleneck.

How do I resolve logical replication conflicts and apply worker failures in PostgreSQL?

Resolve logical replication conflicts by debugging the subscriber-side apply workers and checking replication slot state. Troubleshooting checklists help identify whether parallel apply issues or slot mismanagement cause the failures.

Can I add new replication protocol messages and extend output plugins in PostgreSQL?

Yes, you can extend output plugins and add new replication protocol messages by modifying the PostgreSQL source tree. This requires deep knowledge of the replication slot state machine and logical decoding internals.

What causes catalog_xmin retention issues in PostgreSQL logical replication slots?

Catalog_xmin retention issues occur when logical replication slots stop advancing, retaining old catalog rows. This happens when subscriber apply workers cannot process WAL streams, leading to database bloat and slot mismanagement.