Back to Skills

pg_dump Reference

Consult PostgreSQL's pg_dump implementation for guidance on system catalog queries and schema extraction when implementing pgschema features

786stars29forksUpdated 2/17/2026

Security Assessment

Safe(100/100)
Security Score100/100

About pg_dump Reference

The 'pg_dump Reference' skill provides guidance for implementing and debugging pgschema features that involve extracting schema information from PostgreSQL databases. As the canonical PostgreSQL schema dumping tool, pg_dump serves as a reference implementation for correctly querying PostgreSQL system catalogs. This skill aids developers in understanding and utilizing pg_dump’s methods for extracting schema-related data, ensuring compatibility with different PostgreSQL versions and handling various schema object types.

Main features include a detailed workflow for identifying schema objects, finding relevant pg_dump functions, analyzing system catalog queries, and handling special cases such as version compatibility and NULL handling. The skill also outlines how to adapt these approaches to the pgschema codebase, with a focus on Go/pgx integration for database introspection. This ensures developers can implement robust, version-aware schema querying solutions within their applications, adhering to best practices for system catalog queries and DDL formatting.

This skill is primarily useful for developers working with PostgreSQL database introspection, those adding support for new schema objects, and anyone debugging or enhancing system catalog queries. It is particularly beneficial for those managing PostgreSQL schema extraction in systems using pgschema, making it a vital tool for ensuring correctness in schema handling and supporting PostgreSQL features across versions 14-18.

FAQ

When should I use the pg_dump Reference skill?

Use this skill when adding support for new PostgreSQL schema objects, debugging system catalog queries in `ir/inspector.go`, or working with PostgreSQL version-specific features.

Which PostgreSQL versions are supported by this skill?

The skill is designed to support PostgreSQL versions 14-18, including handling version-specific features.

How does this skill help with version compatibility?

The skill provides guidance on how pg_dump handles version-specific queries and differences, ensuring that your schema extraction works across different PostgreSQL versions.

What types of schema objects does this skill support?

The skill covers a wide range of PostgreSQL schema objects, including tables, columns, indexes, triggers, functions, views, sequences, constraints, and more.

How does this skill handle NULL values in system catalogs?

The skill emphasizes the importance of properly handling NULL values, especially when interpreting missing data or default values in system catalogs.

Install pg_dump Reference

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill