extension-development

Create PostgreSQL extension boilerplate with C entry points and hook chaining.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill streamlines the complex process of developing, building, and upgrading PostgreSQL backend loadable extensions, ensuring adherence to strict internal conventions and preventing common integration errors.

Core Features & Use Cases

  • Extension Lifecycle Management: Provides authoritative guidance on creating control files, install scripts, and managing versioned upgrade paths.
  • Hook and GUC Integration: Offers precise patterns for chaining hooks (e.g., ExecutorStart, planner) and defining custom configuration variables.
  • Build System Configuration: Simplifies the choice between PGXS for out-of-tree extensions and meson for in-tree contrib modules.

Quick Start

Use the extension-development skill to generate the boilerplate files and hook-chaining logic for a new PostgreSQL extension named pg-custom-logger.

Frequently Asked Questions about extension-development

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

FAQPage Schema
How do I create a PostgreSQL extension with C-language entry points and GUC definitions?

To create a PostgreSQL extension, you need standardized patterns for C-language entry points, GUC definitions, .control files, and SQL install scripts. The skill provides authoritative guidance on managing the extension lifecycle and hook-chaining mechanisms to ensure compliance with PostgreSQL internal conventions.

What's the best way to chain hooks like ExecutorStart when developing PostgreSQL backend extensions?

Chaining hooks like ExecutorStart in PostgreSQL backend extensions requires precise patterns to maintain internal execution flow. The skill provides specific hook-chaining mechanisms for planner and executor hooks, ensuring proper integration with PostgreSQL's backend processing and preventing common execution errors.

Does this approach support both PGXS and meson build environments for PostgreSQL extensions?

Yes, PostgreSQL extension development supports both PGXS for out-of-tree extensions and meson for in-tree contrib modules. The skill simplifies the choice between these build system configurations, providing standardized patterns for both environments to ensure proper module compilation and loading.

How do I manage versioned upgrade paths for a PostgreSQL loadable extension?

Managing versioned upgrade paths for PostgreSQL loadable extensions involves creating SQL upgrade scripts that chain version transitions. The skill offers extension lifecycle management guidance, supporting the creation of control files and upgrade chains to maintain backward compatibility across extension versions.

Why do my PostgreSQL C extensions fail to load due to internal memory management issues?

PostgreSQL C extensions fail to load when they violate internal memory management and module loading requirements. The skill ensures compliance with PostgreSQL internal conventions by providing standardized patterns for C-language entry points and memory management, preventing common integration errors during extension development.