Validate with Database

Validate PostgreSQL schema drift by comparing pg_dump with pgschema outputs.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Validate that a live PostgreSQL database matches the declarative schema intended by your migrations by cross-checking outputs and inspecting catalogs.

Core Features & Use Cases

  • Cross-validate declarative schema with the actual database state using pg_dump and pgschema.
  • Inspect system catalogs to verify definitions, constraints, and triggers across versions 14-18.
  • Use as an integrated validation step in schema migration workflows to catch drift before applying changes.

Quick Start

Run a live-DB validation by connecting to your PostgreSQL instance and comparing pg_dump with pgschema outputs.

Frequently Asked Questions about Validate with Database

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

FAQPage Schema
How do I detect PostgreSQL schema drift between my migrations and the live database?

Detect PostgreSQL schema drift by connecting to a live database and cross-checking pg_dump outputs with pgschema results to validate that declarative schema files align with actual database state. This catches drift before applying changes in migration workflows.

What is the best way to validate declarative schema files against a live Postgres database?

Validating declarative schema against a live Postgres database is best done by comparing pg_dump outputs with pgschema results. This cross-validation process ensures your intended schema definitions match the actual database state.

Can I inspect PostgreSQL system catalogs to verify constraints and triggers across versions 14 to 18?

Yes, you can inspect PostgreSQL system catalogs to verify definitions, constraints, and triggers across versions 14 through 18. The validation process queries these catalogs directly to confirm the actual database state matches your schema.

Do I need psql and pg_dump installed to cross-check live Postgres schemas?

Yes, you need psql and pg_dump installed to cross-check live Postgres schemas. The validation process requires a running PostgreSQL instance and access to these client tools to execute pgschema commands and compare outputs.

When should I run a schema validation step in my database migration workflow?

Run a schema validation step in your database migration workflow before applying changes to catch drift early. Cross-checking pg_dump outputs with pgschema results serves as an integrated validation step to ensure declarative schemas match the live database state.