apgdiff
What it is
apgdiff is a free command-line tool for comparing PostgreSQL schema dump files. Give it an original dump and a newer dump, and it generates DDL statements to update the old schema or display the differences. Generated SQL can be printed in a terminal or redirected to a file. The project describes batch jobs and web applications as possible ways to call the tool. apgdiff is written in Java, and installation requires Java 1.6 or newer. The homepage lists Windows, Linux, Mac OS X, Solaris and BSD, and says it can run on other systems with Java available. The download page identifies version 2.4 as the latest stable release and offers binary and source ZIP files. Supported SQL includes selected ALTER, CREATE, COMMENT and SET search_path statements; other SQL statements are ignored, and an option reports ignored DDL. For CREATE TABLE column constraints, support is limited to NULL and NOT NULL. The project is MIT licensed, and its usage guidance recommends reviewing generated upgrade SQL before applying it to production.
For and against
For
- Free under the MIT License.
- Can print SQL or redirect it to a file.
- Supports Windows, Linux, Mac OS X, Solaris and BSD.
- Can report ignored DDL statements.
Against
- Requires Java 1.6 or newer.
- Other SQL statements are ignored.
- Column constraints support only NULL and NOT NULL.
- Latest stable release listed is version 2.4.
The verdict
apgdiff offers a focused way to compare PostgreSQL schema dumps and produce SQL changes. Its selective SQL coverage makes reviewing generated statements important before production use.
Who it suits
apgdiff may suit PostgreSQL users comfortable with terminal workflows who need to compare schema dumps or generate upgrade statements. Its command-line format may be inconvenient for users who prefer graphical tools.
Plans and prices
Free
Free PostgreSQL schema diff tool · MIT licensed
Read 4 Oct 2026 · apgdiff.com
On the record
- 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.apgdiff.com · read 4 Oct 2026
- Download
- The download page identifies version 2.4 as the latest stable release and offers binary and source ZIP downloads.apgdiff.com · read 4 Oct 2026
- Feature constraint
- For CREATE TABLE column constraints, the supported features page says only NULL and NOT NULL are supported.apgdiff.com · read 4 Oct 2026
- License
- The project is licensed under the MIT License.apgdiff.com · read 4 Oct 2026
- 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.apgdiff.com · read 4 Oct 2026
- Purpose
- apgdiff compares two PostgreSQL database schema dump files and outputs DDL statements to update the old schema or show the differences.apgdiff.com · read 4 Oct 2026
- Review generated SQL
- The usage guide recommends reviewing generated upgrade statements and possibly testing them on another database before applying them to production.apgdiff.com · read 4 Oct 2026
- Runtime
- apgdiff is a Java program and its installation page requires Java 1.6 or newer.apgdiff.com · read 4 Oct 2026
- 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.apgdiff.com · read 4 Oct 2026
- Support
- The site directs users to GitHub Issues to report bugs or request features and lists the author’s email for comments and suggestions.apgdiff.com · read 4 Oct 2026
- 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.apgdiff.com · read 4 Oct 2026
- Unsupported statements
- Other SQL statements are ignored, and the --output-ignored-statements option reports DDL statements the tool currently ignores.apgdiff.com · read 4 Oct 2026
- 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.apgdiff.com · read 4 Oct 2026
- 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.apgdiff.com · read 4 Oct 2026
The review
apgdiff is a free Java command-line utility for comparing two PostgreSQL schema dumps and generating DDL for the changes. It is best suited to developers and database administrators who already work in terminals and need a focused migration-script step. The trade-off is selective SQL coverage, so its output belongs in a review-and-test workflow rather than an automatic production deployment.
Overview
Supply an original dump and a newer dump, and apgdiff produces statements that update the old schema or show the differences. You can print the SQL directly or redirect it to a file, which fits batch jobs and web applications that need repeatable command-line output. It compares dump files, not live databases, and its database scope is PostgreSQL only.
The project is MIT licensed and costs nothing to use. Version 2.4 is identified as the latest stable release, with binary and source ZIP downloads; that release was published on September 21, 2012. That history makes apgdiff a lean, bounded utility, but teams choosing software for a changing database process should consider whether its release cadence meets their needs. GitHub Issues is the route for bug reports and feature requests.
Key features
Supported statement categories include 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. When a schema change stays within those categories, apgdiff can turn two snapshots into a migration script without a graphical database workspace.
The boundaries matter. SQL outside the supported set is ignored, while --output-ignored-statements can report DDL that was skipped. CREATE TABLE column constraints are limited to NULL and NOT NULL. That means the generated script is a useful starting point for covered structures, not proof that every change in a dump has been represented. The usage guidance calls for reviewing the generated upgrade statements and, when appropriate, trying them on another database before production application.
As a Java program, it requires Java 1.6 or newer. The terminal interface is a strength for scripted pipelines and experienced operators, but the project itself notes that this style can be inconvenient for people who are not accustomed to command-line applications.
Pricing
Free — free. The plan includes the complete free tool, migration-script generation, and MIT-licensed use. There is no paid tier or free trial to evaluate, so the decision is about technical fit rather than subscription cost. The saving comes with no graphical workflow or broader database-engine coverage: apgdiff remains a PostgreSQL-focused command-line program, and its SQL omissions still require manual review.
Platforms
apgdiff runs on Linux, macOS, and Windows. The project also lists Solaris and BSD, and says it can run on other systems where Java is available. Binary and source ZIP downloads give teams a choice between a packaged installation and building from source.
Who it's for
Choose apgdiff when you need to compare PostgreSQL dump files inside a terminal, batch process, or web-application workflow and your schema uses the supported statement families. It is particularly suitable for teams that want a small MIT-licensed component to produce migration SQL for later inspection.
Look elsewhere if you need cross-database support, a visual schema-comparison environment, or dependable handling of SQL beyond apgdiff's documented subset. It is also a weaker fit for users who prefer GUI tools or for teams uncomfortable accounting for ignored statements and the project's dated 2.4 release.
Pros and cons
Pros
- No cost and MIT license: there is no subscription barrier, and the license suits broad use and modification.
- Script-friendly output: command-line input and file redirection fit repeatable batch or application workflows.
- Multiple operating systems: Linux, macOS, Windows, plus other Java-capable systems, accommodate mixed environments.
- Migration-script focus: it turns dump differences into DDL for a clearly defined PostgreSQL task.
Cons
- Incomplete SQL coverage: unsupported statements are ignored, so every generated script needs inspection.
- Strict table-constraint limit: CREATE TABLE constraints support only NULL and NOT NULL.
- PostgreSQL only: it cannot serve a multi-engine schema-comparison program.
- Terminal-only workflow: users seeking a visual interface may find the process inconvenient.
- Dated stable release: version 2.4 dates from 2012, a concern for teams expecting frequent updates.
Alternatives
For a broader comparison starting point, see Database Schema Comparison Tools.
dbForge Studio for PostgreSQL is the better choice when you want a freemium graphical environment with a free trial and features such as code completion, formatting, query history, visual data editing, and import/export.
Pick Skeema when a freemium workflow with tables, stored procedures and functions, and linter checks is more important than apgdiff's narrow dump-to-dump utility.
sqldef is another free, MIT-licensed command-line schema-comparison option for Linux, macOS, self-hosted, and Windows environments.
driftcurve is a free self-hosted option available through API, web, or local modes.
pgquarrel is a free BSD-3-Clause-licensed alternative for Linux, Windows, and self-hosted use.
UserFolderMigrator is a free MIT-licensed Windows-only tool.
Windows Malicious Software Removal Tool is a free Windows utility aimed at prevalent malware families, not schema comparison.
dbdiff is another free schema-comparison tool for Linux, macOS, self-hosted, and Windows.
Verdict
apgdiff is a sensible choice for PostgreSQL teams that want free, scriptable migration DDL from two schema dumps and are prepared to inspect the result. Its main reason to choose it is focused, cross-platform command-line simplicity; its main reason to look elsewhere is selective, potentially incomplete SQL handling combined with a stable release that dates to 2012.