# 使用 Homebrew, apt, MacPorts, Nix 安装 apgdiff

查看 apgdiff 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

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

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install apgdiff
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install apgdiff
```

  证据: 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
```

  证据: 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
```

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

## 软件包事实

- **软件包键:** brew:apgdiff
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/apgdiff>
- **版本:** 2.7.0
- **来源摘要:** Another PostgreSQL diff tool
- **主页:** <https://www.apgdiff.com/>
- **仓库:** <https://github.com/fordfrog/apgdiff>
- **上游文档:** <https://github.com/fordfrog/apgdiff#readme>
- **许可证:** MIT
- **源码归档:** <https://github.com/fordfrog/apgdiff/archive/refs/tags/release_2.7.0.tar.gz>
- **已生成:** 2026-07-08T07:18:31+00:00

## 可执行文件

- apgdiff (cli)
- apgdiff (别名)

## 依赖

- openjdk

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 all

## 版本和新鲜度

- 页面生成时间: 2026-07-08
- 管理器版本: 2.7.0
- 本地数据: OK
- 上游仓库: https://github.com/fordfrog/apgdiff
- 信息: No package-manager update timestamp was available.
- 信息: No cached GitHub release or tag data was available.
## 项目历史与用法

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.

### 项目历史

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.

### 采用历史

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.

### 使用方式

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.

### 为什么软件包爱好者会关心

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.

### 时间线

- 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.

### 来源

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


## 安全说明

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

- **Geiger 风险:** blue / 中
- broad file, network, media, or database tool signal

## 源数据库详情

- **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

## 其他软件包管理器记录

- 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


## 相关链接

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


## 来源

- 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
