node-infrastructure

Extend PostgreSQL tagged-union Node types with gen_node_support.pl.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill resolves the complexity of navigating and extending PostgreSQL's tagged-union Node system, preventing common errors like incorrect tree traversal, serialization bugs, and manual code-generation mistakes.

Core Features & Use Cases

  • Node System Guidance: Provides authoritative instructions on adding new Node types, modifying struct fields, and managing the NodeTag enum.
  • Infrastructure Automation: Explains the role of gen_node_support.pl and the generated function families (copy, equal, out, read) to ensure consistency across the source tree.
  • Tree Traversal Support: Offers patterns for implementing expression_tree_walker and expression_tree_mutator to safely navigate complex parse, plan, and execution trees.

Quick Start

Use the node-infrastructure skill to guide the process of adding a new Node type to the PostgreSQL source tree.

Frequently Asked Questions about node-infrastructure

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

FAQPage Schema
How does the PostgreSQL Node type system work internally?

The PostgreSQL Node type system uses tagged-union structures managed by a NodeTag enum, enabling internal code to handle diverse parse, plan, and execution tree nodes through generated copy, equal, out, and read function families.

How do I add a new Node type to the PostgreSQL source tree?

To add a new PostgreSQL Node type, you extend the tagged-union structures, update the NodeTag enum, and run the gen_node_support.pl code generator to automatically produce the required copy, equal, out, and read functions.

What is the best way to implement tree walkers and mutators in PostgreSQL?

The best way to implement PostgreSQL tree walkers and mutators is by following established patterns for expression_tree_walker and expression_tree_mutator, ensuring safe navigation and modification of complex parse, plan, and execution trees.

Do I need to manually write copy, equal, out, and read functions for new PostgreSQL struct fields?

You do not need to manually write these functions for new PostgreSQL struct fields; the gen_node_support.pl code generator automatically creates the copy, equal, out, and read function families to maintain source tree consistency.

Why does modifying existing struct fields in PostgreSQL cause serialization bugs?

Modifying PostgreSQL struct fields without updating the NodeTag enum or rerunning gen_node_support.pl causes serialization bugs because the generated out and read function families become desynchronized from the actual tagged-union structure.

Can I use gen_node_support.pl for maintaining PostgreSQL expression tree traversal integrity?

Yes, gen_node_support.pl maintains PostgreSQL expression tree traversal integrity by generating consistent function families that expression_tree_walker and expression_tree_mutator rely on to safely navigate tagged-union structures.