fdw-development

Guide PostgreSQL FDW development through FdwRoutine callback implementation and pushdown optimization.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the complexity of building or extending Foreign Data Wrappers (FDW) in PostgreSQL, ensuring developers correctly implement the FdwRoutine callback interface and handle pushdown logic without introducing security vulnerabilities or performance bottlenecks.

Core Features & Use Cases

  • Callback Implementation: Provides guidance on the full lifecycle of FdwRoutine callbacks, from planner-time path generation to executor-time scan and DML operations.
  • Pushdown Optimization: Assists in implementing expression pushdown, join pushdown, and aggregate pushdown to maximize remote execution efficiency.
  • Security Auditing: Offers best practices for implementing the password_required defense pattern and preventing RLS bypasses in loopback scenarios.

Quick Start

Use the fdw-development skill to guide the implementation of a new FdwRoutine callback set for a custom foreign data source.

Frequently Asked Questions about fdw-development

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

FAQPage Schema
How do I implement PostgreSQL Foreign Data Wrapper callbacks correctly?

PostgreSQL Foreign Data Wrapper callbacks are implemented by defining the FdwRoutine interface, covering planner-time path generation through executor-time scan and DML operations. Proper implementation requires referencing the postgres_fdw implementation to ensure correct lifecycle handling.

What is query pushdown in PostgreSQL FDW development?

Query pushdown in PostgreSQL FDW development is the process of delegating expression, join, and aggregate operations to the remote data source. Implementing pushdown maximizes remote execution efficiency by minimizing data transfer and leveraging the foreign server's processing capabilities.

How do I prevent Row Level Security bypasses in PostgreSQL loopback FDW scenarios?

Preventing Row Level Security bypasses in PostgreSQL loopback FDW scenarios involves implementing the password_required defense pattern. Security auditing ensures that foreign tables do not inadvertently expose restricted rows when accessing local data through a loopback connection.

Does implementing a custom PostgreSQL FDW require deep backend knowledge?

Implementing a custom PostgreSQL FDW requires deep knowledge of the backend foreign-table subsystem and the postgres_fdw reference implementation. Developers need familiarity with the FdwRoutine callback interface to handle scan, DML, and pushdown logic without introducing bottlenecks.

What are the limitations of PostgreSQL Foreign Data Wrapper pushdown logic?

Limitations of PostgreSQL Foreign Data Wrapper pushdown logic involve the risk of introducing performance bottlenecks and security vulnerabilities. Incorrectly implemented expression, join, or aggregate pushdown can fail to maximize remote execution efficiency or expose data through RLS bypasses.