pg-schema-diff
« Back to VersTracker
Description:
Diff Postgres schemas and generating SQL migrations
Type: Formula  |  Latest Version: 1.0.2@0  |  Tracked Since: Dec 27, 2025
Links: Homepage  |  formulae.brew.sh
Category: Databases
Tags: postgresql database migrations devops sql
Install: brew install pg-schema-diff
About:
pg-schema-diff is a CLI tool that compares PostgreSQL database schemas to detect differences and automatically generates SQL migration scripts. It helps developers manage schema changes safely by producing idempotent SQL that can be applied to synchronize databases. Its main value is automating and standardizing schema migrations, reducing manual errors in database deployment workflows.
Key Features:
  • Compares PostgreSQL schemas across databases or DDL files
  • Generates idempotent SQL migration scripts automatically
  • Supports dry-run mode to preview changes before applying
  • Handles complex schema objects like tables, indexes, and constraints
  • Integrates into CI/CD pipelines for automated schema validation
Use Cases:
  • Automating database schema migrations in development and production environments
  • Validating schema changes in CI pipelines to prevent drift between environments
Alternatives:
  • sqitch – More comprehensive database change management with versioning, while pg-schema-diff focuses on diff generation
  • liquibase – Cross-database migration tool with XML/YAML configs, whereas pg-schema-diff is PostgreSQL-specific and SQL-focused
Version History
Detected Version Rev Change Commit
Dec 27, 2025 4:37pm 1.0.2 0 VERSION_BUMP 11cc7fc5
Oct 9, 2025 11:03am 0 VERSION_BUMP 128fe1df