executor-and-planner

Guide PostgreSQL executor and planner node implementation with checklists.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill addresses the complexity of modifying PostgreSQL internals, specifically the tight coupling between the planner's path generation and the executor's node dispatching, preventing common runtime errors like unrecognized node types.

Core Features & Use Cases

  • Node Lifecycle Management: Provides a structured checklist for implementing new executor nodes, including initialization, execution, and teardown.
  • Planner Integration: Guides the implementation of new Path and Plan types, ensuring correct cost estimation and EXPLAIN wiring.
  • Use Case: When adding a custom scan node or a new join strategy, this skill ensures all four required trees (Plan, PlanState, Path, and dispatch switches) remain synchronized to avoid runtime crashes.

Quick Start

Use the executor-and-planner skill to guide the implementation of a new custom scan node including the necessary Plan and PlanState structures.

Frequently Asked Questions about executor-and-planner

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

FAQPage Schema
How do I add a new executor node in PostgreSQL without causing runtime crashes?

To add a new PostgreSQL executor node safely, synchronize all four required trees: Plan, PlanState, Path, and dispatch switches. Adhering to strict node-tagging conventions and memory context discipline prevents unrecognized node type errors during query execution.

How does the PostgreSQL query planner integrate with the executor when adding a new join strategy?

The PostgreSQL query planner integrates with the executor by requiring new Path and Plan types to have correct cost estimation and EXPLAIN wiring. This ensures the planner's path generation and the executor's node dispatching remain synchronized across the query execution pipeline.

What causes unrecognized node type errors when modifying PostgreSQL internals?

Unrecognized node type errors in PostgreSQL internals are caused by tight coupling between the planner's path generation and the executor's node dispatching. Failing to update node tags or maintain memory context discipline when adding plan nodes triggers these runtime crashes.

What is the correct lifecycle for a custom scan node in the PostgreSQL executor?

The correct lifecycle for a PostgreSQL custom scan node requires structured initialization, execution, and teardown phases. Implementing the necessary Plan and PlanState structures while maintaining memory context compatibility ensures the custom scan node executes properly within the query pipeline.

Can I adjust the cost model in the PostgreSQL query planner for a new path type?

Yes, you can adjust the PostgreSQL query planner cost model when implementing new Path types. Correct cost estimation and proper EXPLAIN wiring are required to ensure the new path type integrates with the existing planner and executor subsystems without runtime errors.

Do I need C programming experience to modify the PostgreSQL executor and planner subsystems?

Yes, C programming experience is required to modify the PostgreSQL executor and planner subsystems. Tasks involve adding new plan nodes, path types, and cost model adjustments within the PostgreSQL source tree, demanding adherence to strict node-tagging conventions and memory context discipline.