gucs-config

Implement and validate custom PostgreSQL GUC variables with hooks and memory rules.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill eliminates the guesswork and common pitfalls associated with defining custom PostgreSQL GUC variables, ensuring your patches and extensions follow strict internal conventions for hooks, memory management, and lifecycle safety.

Core Features & Use Cases

  • DefineCustomVariable Implementation: Provides a procedural guide for all five typed GUC entry points, including proper hook wiring and flag selection.
  • Lifecycle Management: Ensures correct usage of MarkGUCPrefixReserved and proper GucContext selection to prevent runtime errors or memory leaks.
  • Hook Validation: Offers a robust framework for implementing check, assign, and show hooks that adhere to PostgreSQL's memory and transaction state requirements.

Quick Start

Use the gucs-config skill to generate the boilerplate code for a new custom GUC variable including the required check and assign hooks.

Frequently Asked Questions about gucs-config

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

FAQPage Schema
What are PostgreSQL GUC check and assign hooks used for?

PostgreSQL GUC check and assign hooks validate custom variable values while adhering to PostgreSQL's internal memory and transaction state requirements. They ensure runtime safety by enforcing strict internal conventions during variable assignment and display operations.

When do I need to reserve a custom GUC prefix in PostgreSQL?

You need to reserve a custom GUC prefix in PostgreSQL during lifecycle management to prevent runtime errors or memory leaks. Using MarkGUCPrefixReserved ensures your extension complies with internal standards for variable registration and namespace safety.

How do I make custom PostgreSQL GUC variables compatible with parallel workers?

To make custom PostgreSQL GUC variables compatible with parallel workers, ensure proper GucContext selection and adhere to parallel-worker compatibility standards during variable registration. This skill enforces these internal PostgreSQL requirements during GUC definition.

Why are my custom PostgreSQL GUC hooks causing memory leaks?

Custom PostgreSQL GUC hooks cause memory leaks when lifecycle management rules are ignored, specifically failing to use MarkGUCPrefixReserved or selecting an incorrect GucContext. Proper hook validation must align with PostgreSQL's memory allocation and transaction state requirements.