access-method-apis

Implement PostgreSQL pluggable index and table access methods with routine callbacks.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides the technical framework and architectural guidance required to implement or modify PostgreSQL pluggable storage engines, preventing common pitfalls in AM routine callbacks and catalog registration.

Core Features & Use Cases

  • AM Routine Implementation: Provides authoritative guidance on IndexAmRoutine and TableAmRoutine callback structures, including build, insert, scan, and vacuum operations.
  • Catalog & Opclass Management: Details the registration process for new access methods, operator classes, and support functions within the PostgreSQL system catalogs.
  • Use Case: Use this skill when developing a custom index type or a specialized table storage engine to ensure correct integration with the PostgreSQL executor, planner, and WAL subsystems.

Quick Start

Use the access-method-apis skill to guide the implementation of a new IndexAmRoutine for a custom index structure.

Frequently Asked Questions about access-method-apis

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

FAQPage Schema
How do I implement a custom PostgreSQL index access method?

To implement a custom PostgreSQL index access method, you define the IndexAmRoutine callback structure for build, insert, scan, and vacuum operations. This ensures your custom index type integrates correctly with the internal executor and planner subsystems.

What is needed to register a new table access method in PostgreSQL catalogs?

Registering a new table access method requires defining the TableAmRoutine structure and adding entries to PostgreSQL system catalogs. This process ensures your specialized table storage engine is recognized alongside its associated operator classes and support functions.

How does a PostgreSQL storage engine integrate with the WAL subsystem?

A PostgreSQL storage engine integrates with the Write-Ahead Logging (WAL) subsystem by implementing mandatory routine callbacks within its access method. Compliance with these internal API contracts ensures data durability and recovery for your custom storage engine.

Can I modify existing PostgreSQL table access methods instead of building from scratch?

Yes, you can modify existing PostgreSQL table access methods by altering their TableAmRoutine callback structures. This skill provides the architectural guidance to adjust storage engine behaviors while maintaining compliance with core executor and planner subsystems.

When do I need to define operator classes for a custom PostgreSQL index?

You need to define operator classes when registering a custom PostgreSQL index to declare how the index handles specific comparison and query operations. This catalog registration step is mandatory for the planner to recognize and utilize your custom index access method.