# Install apgdiff with Homebrew, apt, MacPorts, Nix

Another PostgreSQL diff tool. Version 2.7.0 via Homebrew; verified from local package data.

## Install

```sh
sudo av install brew:apgdiff
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install apgdiff
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install apgdiff
```

  Evidence: MacPorts ports tree: databases/apgdiff/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- Debian apt (92%):

```sh
sudo apt install apgdiff
```

  Evidence: Debian stable package indexes: apgdiff from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- Nix (92%):

```sh
nix profile install nixpkgs#apgdiff
```

  Evidence: nixpkgs package indexes: pkgs/by-name/ap/apgdiff/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## Package facts

- **Package key:** brew:apgdiff
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/apgdiff>
- **Version:** 2.7.0
- **Source summary:** Another PostgreSQL diff tool
- **Homepage:** <https://www.apgdiff.com/>
- **Repository:** <https://github.com/fordfrog/apgdiff>
- **Upstream docs:** <https://github.com/fordfrog/apgdiff#readme>
- **License:** MIT
- **Source archive:** <https://github.com/fordfrog/apgdiff/archive/refs/tags/release_2.7.0.tar.gz>
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- apgdiff (cli)
- apgdiff (alias)

## Dependencies

- openjdk

## Install behavior

- Post-install hook: not defined
- Bottle: available on all

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 2.7.0
- Local data: ok
- Upstream repository: https://github.com/fordfrog/apgdiff
- info: No package-manager update timestamp was available.
- info: No cached GitHub release or tag data was available.
## Project history and usage

Another PostgreSQL Diff Tool, usually packaged as apgdiff, is a Java command-line utility for comparing PostgreSQL schema dumps and generating DDL needed to move an old schema toward a new one. Its niche is intentionally narrow: it is for schema-diffing PostgreSQL dump files, not for live database migration orchestration.

### Project history

The official site presents apgdiff as a free PostgreSQL database schema diff tool and notes that it compares two database dump files to produce SQL statements describing schema changes. The project predates its GitHub repository: the web site lists 2010-era 2.x releases, and a 2012 news entry says the sources and issue tracker moved to GitHub to make participation easier.

The GitHub README describes the repository as mainly unmaintained, while still accepting useful bug-fix pull requests. The changelog shows the package's long tail of PostgreSQL compatibility work: version 2.0 rewrote the SQL parser, version 2.4 added schema-creation and Slony-trigger options, version 2.5 added materialized views, extensions, foreign tables, grants, and ownership support, version 2.6 added PostgreSQL 10 support, and version 2.7.0 added early support for PostgreSQL 12-era syntax such as partitioning and identity columns.

### Adoption history

The official home page states that apgdiff was already being used by many developers worldwide. The batch input shows it has also crossed into several package-manager ecosystems, including Homebrew, Debian, Ubuntu, MacPorts, and Nix, which is typical for small database utilities that remain useful in scripts long after active feature development slows.

### How it is used

Typical use is to dump two PostgreSQL schemas, run apgdiff against the old and new dumps, and review or apply the generated DDL. The official site emphasizes command-line use from batches and web applications, and the project README points users to GitHub issues for bugs.

Package users care about PostgreSQL version support because apgdiff parses SQL dump syntax. Its changelog is therefore practically part of the compatibility contract: support for materialized views, unlogged tables, extensions, foreign tables, sequences, triggers, rules, grants, views, and newer CREATE syntax determines whether a given schema dump can be diffed safely.

### Why package nerds care

apgdiff is the kind of small, stable package that package managers preserve because it solves one specific operational problem without needing a server. It is especially interesting to PostgreSQL users who want schema comparison in CI or release scripts and are willing to inspect generated SQL rather than adopt a larger migration framework.

### Timeline

- 2010: Version 2.0 rewrote the SQL parser and expanded supported PostgreSQL DDL.
- 2012: The project moved its sources and issue tracker to GitHub.
- 2012: Version 2.4 shipped with trigger, schema, and parser fixes.
- 2016: GitHub releases recorded 2.5.0 prereleases.
- 2018-2020: Changelog entries added PostgreSQL 10, Java 11 development, PostgreSQL 12-related syntax, partitioning, and identity-column support.

### Related projects

- PostgreSQL schema dump tooling, database migration frameworks, and schema comparison utilities are adjacent, but apgdiff remains focused on diffing two PostgreSQL dump files and emitting DDL.

### Sources

- <https://api.github.com/repos/fordfrog/apgdiff>
- <https://github.com/fordfrog/apgdiff#readme>
- <https://www.apgdiff.com/>
- input source_facts.package-manager


## Security Notes

broad file, network, media, or database tool signal.

- **Geiger risk:** blue / medium
- broad file, network, media, or database tool signal

## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** apgdiff
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## Other Package-Manager Records

- Debian apt - apgdiff - 2.7.0-1: normalized package name match | Debian stable package indexes: apgdiff from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Another PostgreSQL Diff Tool | https://www.apgdiff.com/
- Nix - apgdiff: normalized package name match | nixpkgs package indexes: pkgs/by-name/ap/apgdiff/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - apgdiff - 2.7.0-1: normalized package name match | Ubuntu 24.04 LTS package indexes: apgdiff from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Another PostgreSQL Diff Tool | https://www.apgdiff.com/
- MacPorts - apgdiff: normalized package name match | MacPorts ports tree: databases/apgdiff/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Related links

- [Secret-risk packages](https://www.automicvault.com/pkg/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Networking and protocol packages](https://www.automicvault.com/pkg/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [openjdk](https://www.automicvault.com/pkg/brew/openjdk/) - Runtime dependency declared by Homebrew.
- [doltgres](https://www.automicvault.com/pkg/brew/doltgres/) - Shares av.db curated category or tags: cli, data, postgresql, sql.
- [lazysql](https://www.automicvault.com/pkg/brew/lazysql/) - Shares av.db curated category or tags: cli, data, postgresql, sql.
- [anyquery](https://www.automicvault.com/pkg/brew/anyquery/) - Shares av.db curated category or tags: cli, data, sql.
- [apache-drill](https://www.automicvault.com/pkg/brew/apache-drill/) - Shares av.db curated category or tags: cli, data, sql.
- [athenacli](https://www.automicvault.com/pkg/brew/athenacli/) - Shares av.db curated category or tags: cli, data, sql.
- [barman](https://www.automicvault.com/pkg/brew/barman/) - Shares av.db curated category or tags: cli, data, postgresql.
- [beanquery](https://www.automicvault.com/pkg/brew/beanquery/) - Shares av.db curated category or tags: cli, data, sql.
- [check_postgres](https://www.automicvault.com/pkg/brew/check-postgres/) - Shares av.db curated category or tags: cli, data, postgresql.
- [h2](https://www.automicvault.com/pkg/brew/h2/) - Local package facts share a topical domain. Shared terms: cli, data, openjdk, sql.
- [questdb](https://www.automicvault.com/pkg/brew/questdb/) - Local package facts share a topical domain. Shared terms: cli, data, openjdk, sql.
- [trino](https://www.automicvault.com/pkg/brew/trino/) - Local package facts share a topical domain. Shared terms: cli, data, openjdk, sql.

## Combined YAML source

View the package source record on GitHub. [combined/apgdiff.yml](https://github.com/automic-vault/db/blob/main/combined/apgdiff.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
