# libpq を Homebrew, apk, dnf, apt, Nix でインストール

libpq のインストール経路、実行ファイル、メタデータ、AI エージェント向けセキュリティノートを確認します。

## インストール

```sh
sudo av install brew:libpq
```

追加のインストールコマンド:

### macOS

- Homebrew (100%):

```sh
brew install libpq
```

  証拠: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add libpq
```

  証拠: Alpine Linux edge package indexes: libpq from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz

- dnf (92%):

```sh
sudo dnf install libpq
```

  証拠: Fedora Rawhide package metadata: libpq from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

- Debian apt (92%):

```sh
sudo apt install pg-checksums-doc
```

  証拠: Debian stable package indexes: pg-checksums-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- Nix (92%):

```sh
nix profile install nixpkgs#pg_checksums
```

  証拠: nixpkgs package indexes: pkgs/by-name/pg/pg_checksums/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## パッケージ情報

- **パッケージキー:** brew:libpq
- **パッケージマネージャ:** Homebrew
- **バージョン:** 18.4
- **ソース概要:** Postgres C API library
- **ホームページ:** <https://www.postgresql.org/docs/current/libpq.html>
- **生成日時:** 2026-08-03T19:37:03+00:00

## 実行可能ファイル

- clusterdb (エイリアス)
- createdb (エイリアス)
- createuser (エイリアス)
- dropdb (エイリアス)
- dropuser (エイリアス)
- ecpg (エイリアス)
- initdb (エイリアス)
- pg_amcheck (エイリアス)
- pg_archivecleanup (エイリアス)
- pg_basebackup (エイリアス)
- pg_checksums (エイリアス)
- pg_combinebackup (エイリアス)
- pg_config (エイリアス)
- pg_controldata (エイリアス)
- pg_createsubscriber (エイリアス)
- pg_ctl (エイリアス)
- pg_dump (エイリアス)
- pg_dumpall (エイリアス)
- pg_isready (エイリアス)
- pg_receivewal (エイリアス)
- pg_recvlogical (エイリアス)
- pg_resetwal (エイリアス)
- pg_restore (エイリアス)
- pg_rewind (エイリアス)
- pg_test_fsync (エイリアス)
- pg_test_timing (エイリアス)
- pg_upgrade (エイリアス)
- pg_verifybackup (エイリアス)
- pg_waldump (エイリアス)
- pg_walsummary (エイリアス)
- pgbench (エイリアス)
- psql (エイリアス)
- reindexdb (エイリアス)
- vacuumdb (エイリアス)

## インストール挙動

- Bottle: 利用不可

## バージョンと鮮度

- ページ生成日: 2026-08-03
- マネージャ版: 18.4
## プロジェクトの歴史と使われ方

libpq is PostgreSQL's C client library: the small, stable-looking surface that lets C programs connect to PostgreSQL servers, submit queries, and read results. It also underlies several other PostgreSQL client interfaces, so packaging it separately gives developers the client headers, shared library, and familiar tools without requiring a Homebrew PostgreSQL server installation.

### プロジェクトの歴史

PostgreSQL descends from the Berkeley POSTGRES project, whose implementation began in 1986. The Postgres95 transition in 1994 replaced POSTQUEL with SQL and introduced `psql`; the PostgreSQL name arrived in 1996 to connect the POSTGRES heritage with SQL support.

The PostgreSQL manual notes that the `libpq` name came from PostQUEL. As PostgreSQL matured into a long-lived open source database, libpq became the canonical C API for client programs and a shared substrate for other language bindings and command-line clients.

### 採用の歴史

libpq's adoption follows PostgreSQL's adoption: applications, drivers, migration tools, backup tools, and admin scripts need a PostgreSQL client layer even when the database server runs elsewhere. PostgreSQL's 2023 project announcement described the system as benefiting from more than 25 years of open source development and a global community of users, contributors, companies, and organizations.

Homebrew's `libpq` formula packages the client side as a keg-only formula. That matters on developer workstations because it avoids colliding with a full `postgresql` formula while still making `psql`, `pg_dump`, `pg_restore`, `pg_config`, and the C library available to builds and scripts.

### 使われ方

Typical package-manager use is installing libpq so native extensions, database drivers, and command-line workflows can compile or run against PostgreSQL. Developers use `pg_config` to find build flags, `psql` for interactive sessions, and the dump/restore utilities for movement between PostgreSQL instances.

### パッケージ好きにとっての重要性

libpq is package-nerd significant because it is a dependency edge disguised as a database client. Many packages need PostgreSQL client headers and link libraries, but users often do not want a local database server; a separate formula keeps that dependency smaller and less invasive.

It also exposes PostgreSQL's major-version reality to package managers: client utilities can speak across versions, but dump, restore, upgrade, and extension-building workflows often care about exact major lines. That is why versioned formulae such as `libpq@16` and `libpq@17` are useful beside the unversioned formula.

### タイムライン

- 1986: Implementation of the Berkeley POSTGRES project began at the University of California at Berkeley.
- 1994: Postgres95 added an SQL interpreter and `psql`, replacing POSTQUEL and the older monitor program.
- 1996: The project adopted the PostgreSQL name and reset version numbering to 6.0.
- 2023-09-14: PostgreSQL 16 was released, including libpq load-balancing support among its client-side changes.
- 2024-09-26: PostgreSQL 17 was released with new client and administration utilities including `pg_createsubscriber` and `pg_combinebackup`.

### Related projects

- PostgreSQL server, `psql`, ECPG, PostgreSQL client utilities, language drivers that use libpq, and Homebrew's versioned `libpq@16` and `libpq@17` formulae are the closest related projects.

### ソース

- <https://formulae.brew.sh/formula/libpq>
- <https://www.postgresql.org/about/news/postgresql-16-released-2715/>
- <https://www.postgresql.org/about/press/presskit17/>
- <https://www.postgresql.org/docs/current/history.html>
- <https://www.postgresql.org/docs/current/libpq.html>
- <https://www.postgresql.org/support/versioning/>


## セキュリティノート

libpq に一致するローカルシークレット処理マニフェストは見つかりませんでした。将来の対応で安定したパッケージ URL を使えるよう、Nucleus パッケージメタデータはここに公開されています。



## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: psqlrc in the directory reported by pg_config --sysconfdir, ~/.psqlrc, pg_service.conf in the directory reported by pg_config --sysconfdir, ~/.pg_service.conf
- Windows: %APPDATA%\postgresql\psqlrc.conf, %APPDATA%\postgresql\.pg_service.conf

## Credential files

- Unix: ~/.pgpass
- Windows: %APPDATA%\postgresql\pgpass.conf
## 他のパッケージマネージャ記録

- apk - libpq - 18.4-r0: normalized package name match | Alpine Linux edge package indexes: libpq from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | PostgreSQL client library | https://www.postgresql.org/
- dnf - libpq - 18.4-4.fc45: normalized package name match | Fedora Rawhide package metadata: libpq from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | PostgreSQL client library | http://www.postgresql.org/
- dnf - libpq-devel - 18.4-4.fc45: normalized package name match | Fedora Rawhide package metadata: libpq-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Development files for building PostgreSQL client tools | http://www.postgresql.org/
- Debian apt - pg-checksums-doc - 1.2-2: installed executable or alias match | Debian stable package indexes: pg-checksums-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Activate/deactivate/verify PostgreSQL data checksums (Documentation) | https://github.com/credativ/pg_checksums
- Debian apt - postgresql-17-pg-checksums - 1.2-2: installed executable or alias match | Debian stable package indexes: postgresql-17-pg-checksums from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Activate/deactivate/verify PostgreSQL data checksums | https://github.com/credativ/pg_checksums
- Nix - pg_checksums: installed executable or alias match | nixpkgs package indexes: pkgs/by-name/pg/pg_checksums/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - pg-checksums-doc - 1.1-6: installed executable or alias match | Ubuntu 24.04 LTS package indexes: pg-checksums-doc from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Activate/deactivate/verify PostgreSQL data checksums (Documentation) | https://github.com/credativ/pg_checksums
- Ubuntu apt - postgresql-16-pg-checksums - 1.1-6: installed executable or alias match | Ubuntu 24.04 LTS package indexes: postgresql-16-pg-checksums from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Activate/deactivate/verify PostgreSQL data checksums | https://github.com/credativ/pg_checksums


## Combined YAML source

View the package source record on GitHub. [combined/libpq.yml](https://github.com/mxcl/pkgdb/blob/main/combined/libpq.yml)


## ソース

- pkg.so package database
- Geiger risk classifier
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
