Validate with Database

Validate live PostgreSQL schemas by comparing pg_dump and pgschema outputs.

994|57|Updated Jun 8, 2025
One-click install
npx skills add https://github.com/pgschema/pgschema --skill validate-with-database
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Validate with Database
Source: https://github.com/pgschema/pgschema/tree/main/.claude/skills/validate_db
Command: npx skills add https://github.com/pgschema/pgschema --skill validate-with-database

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Connect to a live PostgreSQL database to validate schema assumptions, compare pg_dump and pgschema outputs, and inspect system catalogs interactively.

Core Features & Use Cases

  • Cross-validate database schemas by comparing actual database state with schema files and dumps.
  • Inspect system catalogs and metadata to verify object definitions, constraints, and indexes.
  • Validate migration plans and reproduce plan results across PostgreSQL versions 14-18.
  • Debug schema introspection issues by querying catalog data and comparing with expected results.

Quick Start

Run a quick validation workflow by dumping the target schema with pg_dump and comparing the results with pgschema output, then query system catalogs to verify definitions.

Frequently Asked Questions about Validate with Database

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

FAQPage Schema
How do I validate a live PostgreSQL schema against a dump file?

To validate a live PostgreSQL schema, you can cross-check the actual database state by comparing pg_dump outputs with pgschema outputs and interactively querying system catalogs to verify object definitions.

How do I inspect PostgreSQL system catalogs to debug schema introspection issues?

Inspecting PostgreSQL system catalogs involves querying metadata directly to verify object definitions, constraints, and indexes, allowing you to reproduce and compare expected results against the actual live database state.

Can I validate PostgreSQL migration plans across different database versions?

You can validate PostgreSQL migration plans by reproducing and verifying plan results across PostgreSQL versions 14 through 18 using interactive catalog queries and schema state comparisons.

Do I need environment credentials to validate schemas in a live PostgreSQL database?

Yes, validating live PostgreSQL schemas requires a live database accessible via environment credentials to connect, query catalogs, compare outputs, and execute end-to-end validation workflows.

What is the best way to compare pg_dump and pgschema outputs for schema validation?

The best way to compare pg_dump and pgschema outputs is to run an end-to-end workflow that dumps the target schema, compares the results against pgschema output, and queries system catalogs to verify definitions.