apgdiff
github.com
What it is
apgdiff is a free command-line tool that compares two PostgreSQL schema dump files and generates DDL statements to update an older schema or show differences. It takes an original dump and a new dump as inputs; generated SQL can be printed in the terminal or redirected to a file. The project says it can be called from batch jobs or web applications. It is written in Java and requires Java 1.6 or newer. Listed systems include Windows, Linux, Mac OS X, Solaris, and BSD, as well as other systems where Java is available. Version 2.4 is identified as the latest stable release, with binary and source ZIP downloads. Support covers selected ALTER SEQUENCE, ALTER TABLE, ALTER VIEW, COMMENT, CREATE FUNCTION, CREATE INDEX, CREATE SCHEMA, CREATE SEQUENCE, CREATE TABLE, CREATE TRIGGER, CREATE VIEW, and SET search_path statements. Other SQL statements are ignored, and an option reports ignored DDL. For CREATE TABLE column constraints, only NULL and NOT NULL are supported. The project uses the MIT License and recommends reviewing generated upgrade SQL before applying it.
Spec sheet
- Purpose
- apgdiff compares two PostgreSQL database schema dump files and outputs DDL statements to update the old schema or show the differences.Read 4 Oct 2026 · apgdiff.com
- Support
- The site directs users to GitHub Issues to report bugs or request features and lists the author’s email for comments and suggestions.Read 4 Oct 2026 · apgdiff.com
- License
- The project is licensed under the MIT License.Read 4 Oct 2026 · apgdiff.com
- Founded
- 2006Read 28 Sep 2026 · github.com
- Command line
- apgdiff is a command-line tool run from a terminal and the homepage says it is useful to call from batches or web applications.Read 4 Oct 2026 · apgdiff.com
- Download
- The download page identifies version 2.4 as the latest stable release and offers binary and source ZIP downloads.Read 4 Oct 2026 · apgdiff.com
- Feature constraint
- For CREATE TABLE column constraints, the supported features page says only NULL and NOT NULL are supported.Read 4 Oct 2026 · apgdiff.com
- Project activity
- The project news page lists version 2.4 as released on 2012-09-21 and says the project moved to GitHub on 2012-08-03.Read 4 Oct 2026 · apgdiff.com
- Review generated SQL
- The usage guide recommends reviewing generated upgrade statements and possibly testing them on another database before applying them to production.Read 4 Oct 2026 · apgdiff.com
- Runtime
- apgdiff is a Java program and its installation page requires Java 1.6 or newer.Read 4 Oct 2026 · apgdiff.com
- SQL coverage
- The supported statements page lists support for selected ALTER SEQUENCE, ALTER TABLE, ALTER VIEW, COMMENT, CREATE FUNCTION, CREATE INDEX, CREATE SCHEMA, CREATE SEQUENCE, CREATE TABLE, CREATE TRIGGER, CREATE VIEW, and SET search_path statements.Read 4 Oct 2026 · apgdiff.com
- Supported systems
- The homepage lists Windows, Linux, Mac OS X, Solaris, and BSD, and says it can run on other systems where Java is available.Read 4 Oct 2026 · apgdiff.com
- Unsupported statements
- Other SQL statements are ignored, and the --output-ignored-statements option reports DDL statements the tool currently ignores.Read 4 Oct 2026 · apgdiff.com
- Who it serves
- The homepage says the command-line format suits users accustomed to command-line applications and may be inconvenient for users who are not.Read 4 Oct 2026 · apgdiff.com
- Workflow
- It takes an original schema dump and a new schema dump as input, and can print the generated SQL or redirect it to a file.Read 4 Oct 2026 · apgdiff.com
Plans and prices
Strong points and limits
Strong points
- Compares PostgreSQL schema dump files.
- Generated SQL can be redirected to a file.
- An option reports ignored DDL statements.
- Runs on systems where Java is available.
- MIT licensed and free.
Limits
- Other SQL statements are ignored.
- Column constraints support only NULL and NOT NULL.
- Java 1.6 or newer is required.
- The latest stable release listed is version 2.4.
Who it suits
apgdiff suits PostgreSQL users comfortable with terminal-based tools who need schema-difference SQL for a migration workflow. Its command-line format may be inconvenient for users who are not accustomed to command-line applications.
apgdiff in depth
Read the full write-up
apgdiff is a free Java command-line utility for turning differences between two PostgreSQL schema dumps into update SQL. It is best suited to developers and database administrators who already work in terminals and need a scriptable step in batch jobs or web applications. Its focused PostgreSQL remit is useful, but the generated DDL demands inspection before it becomes a production migration.
Overview
You supply an older schema dump and a newer one; apgdiff compares them and either prints the resulting DDL or redirects it to a file. That workflow fits automated pipelines and repeatable migration preparation better than teams looking for a graphical database workbench. The scope is deliberately narrow: it compares PostgreSQL schemas, not several database engines or live databases as a general administration environment.
The project is MIT licensed and costs nothing. Version 2.4 is identified as the latest stable release, with binary and source ZIP downloads; that release dates from 2012. GitHub Issues handles bug reports and feature requests. The age of the stable release is a practical consideration for teams whose PostgreSQL syntax or delivery process changes quickly.
Key features
apgdiff can generate migration scripts from schema snapshots, making it suitable when the desired artifact is executable DDL rather than a visual report. Its supported statement set includes selected ALTER SEQUENCE, ALTER TABLE, ALTER VIEW, COMMENT, CREATE FUNCTION, CREATE INDEX, CREATE SCHEMA, CREATE SEQUENCE, CREATE TABLE, CREATE TRIGGER, CREATE VIEW and SET search_path forms. Projects whose changes stay within those constructs can use it as a compact diff-to-migration step.
Coverage is selective rather than a promise to understand every statement in a dump. SQL outside the supported set is ignored, and the --output-ignored-statements option can report those omissions. CREATE TABLE column constraints are limited to NULL and NOT NULL, so schemas relying on richer column-level constraints need a separate review and likely additional migration work. The usage guidance calls for checking generated upgrade statements and, where appropriate, trying them against another database before production; that is essential here, not optional polish.
Because it is a terminal program, it can be called from batches and web applications and suits command-line-oriented teams. Users who expect an interactive editor or visual comparison experience will find the workflow less convenient.
Pricing
Free — free. The plan is the complete MIT-licensed utility, with no paid tier, trial period or renewal term. It is a good fit for individual developers and teams that can supply their own automation and validation around PostgreSQL dump comparisons. The trade-off is not a metered quota but the tool's limited SQL coverage and the need to manage review, testing and deployment yourself.
Platforms
apgdiff runs on Linux, macOS and Windows. The project also lists Solaris and BSD, and says other systems can work when Java is available. Installation requires Java 1.6 or newer. Binary and source ZIP packages provide deployment choices, while the Java runtime requirement adds an environment dependency to otherwise simple command-line installation.
Who it's for
Choose apgdiff when your team maintains PostgreSQL schemas as dumps, is comfortable invoking CLI tools, and wants generated DDL that can be redirected into a migration file or pipeline step. It is particularly suitable for narrowly defined schema changes covered by its supported statements.
It is a weaker fit for teams needing broad SQL-language coverage, a graphical workflow, cross-database comparisons, or confidence that every dump statement will be interpreted. If your schema uses constraints beyond NULL and NOT NULL or routinely includes unsupported SQL, plan a manual migration process around the output rather than treating it as a complete answer.
Pros and cons
Pros
Free and MIT licensed: there is no purchase barrier or recurring fee for using the utility.
Migration-oriented output: differences can be printed or saved directly as DDL for a downstream workflow.
Automation-friendly CLI: terminal invocation works well in batches and web applications across major desktop and server platforms.
Ignored-statement reporting: the dedicated option helps identify SQL that the parser did not handle.
Cons
Selective SQL support: unsupported statements are ignored, which can leave a generated migration incomplete.
Restricted column constraints: CREATE TABLE handling supports only NULL and NOT NULL constraints.
PostgreSQL only: it cannot serve a multi-engine schema comparison strategy.
Terminal-first operation: users who need a visual diff or editor may find the workflow cumbersome.
Old stable release: version 2.4 was released in 2012, a concern for long-lived, evolving database programs.
Alternatives
For a broader directory of options, see Database Schema Comparison Tools.
dbForge Studio for PostgreSQL is the better direction when you want a freemium product with a free trial and a Linux, macOS or Windows interface-oriented toolkit.
Pick Redgate SQL Provision instead when provisioning or masking production data across capacity tiers matters more than a free schema-diff CLI.
Skeema suits teams wanting a freemium workflow with a free Community plan and a paid Plus tier, including schema-oriented linting and broader development tooling.
Consider SQL Delta if you specifically need a paid Windows comparison product with a free trial.
sqldef is another free, MIT-licensed open-source CLI option for teams comparing schemas across Linux, macOS, Windows and self-hosted environments.
dbdiff offers a free schema-comparison alternative for Linux, macOS, Windows and self-hosted use.
DBDiff is a free open-source option available on Linux, macOS and Windows.
DBC is another free choice supporting Linux, macOS and Windows.
Verdict
apgdiff is a sensible pick for PostgreSQL-focused, command-line teams that need no-cost DDL generation from schema dumps and can enforce review in their migration process. Choose it for that narrow, automatable job; look elsewhere if incomplete SQL coverage, an aging release, richer constraints or a graphical and cross-engine workflow would create unacceptable risk.
Verdict
apgdiff can turn differences between PostgreSQL schema dumps into DDL, but its SQL coverage is selective. Review the output and consider testing it on another database before production use.
Where Specifiction places it
- Database Schema Comparison Tools#5 of 258.2