Connect to live PostgreSQL database to validate schema assumptions, compare pg_dump vs pgschema output, and query system catalogs interactively
Detected risks:
The 'Validate with Database' skill is designed to connect to a live PostgreSQL database and validate various schema assumptions. It provides users with a mechanism to compare outputs from pg_dump and pgschema, and interactively query system catalogs to verify schema behavior. This tool is particularly useful for testing new PostgreSQL features, debugging schema introspection issues, and validating database migrations before implementation. By leveraging this skill, users can ensure their schema assumptions hold up against a live environment and compare different schema extraction tools for accuracy and completeness.
Main features of this skill include the ability to connect to a PostgreSQL database, run interactive queries using psql, and generate schema dumps with both pg_dump and pgschema. Users can also verify system catalog query results and check for PostgreSQL version-specific behavior between versions 14 and 18. It supports multiple methods for database interaction, including psql for interactive queries, pg_dump for schema exports, and pgschema for schema dumps with more project-specific customization. The skill is also optimized for testing, debugging, and validating schema changes in a controlled environment before production deployment.
This skill is ideal for database administrators, developers, and testers who need to ensure schema consistency, validate assumptions against a real database, and compare outputs from different schema extraction tools. It is especially valuable for those working with PostgreSQL databases and migrating between versions or implementing new features, as it helps in pinpointing issues that may arise from schema misinterpretations or changes between versions.
You can connect using psql, pg_dump, or pgschema. The connection details such as host, port, user, and password are configured in the .env file at the project root.
pg_dump is a PostgreSQL utility for creating schema backups, while pgschema is a project tool designed to generate more customizable schema dumps and compare them interactively.
The skill supports PostgreSQL versions 14 to 18 for version-specific behavior validation.
Yes, this skill is designed to help debug schema introspection issues by comparing different schema extraction methods and validating schema assumptions.
You can create a test database by running the appropriate psql commands to drop any existing test database and create a new one, followed by creating necessary schema objects for testing.
Quick Setup:
.claude/skills/Repository
pgschema/pgschema