Automic VaultAutomic Vault

brew

Install libpq with Homebrew, apk, dnf, apt, Nix

Postgres C API library. Version 18.4 via Homebrew; verified 2026-06-28.

install

Additional install commands

macOS

Homebrewverified · 100%
brew install libpq

local Homebrew formula metadata

Linux

Alpine Linux apkverified · 92%
sudo apk add libpq

Alpine Linux edge package indexes · libpq · source: dl-cdn.alpinelinux.org

Fedora dnfverified · 92%
sudo dnf install libpq

Fedora Rawhide package metadata · libpq · source: dl.fedoraproject.org

Debian aptverified · 92%
sudo apt install pg-checksums-doc

Debian stable package indexes · pg-checksums-doc · source: deb.debian.org

Nixverified · 92%
nix profile install nixpkgs#pg_checksums

nixpkgs package indexes · pkgs/by-name/pg/pg_checksums/package.nix · source: api.github.com

overview

Package summary

Postgres C API library

Commands and aliases

  • 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

history

Project history and usage

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.

Project history

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.

Adoption history

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.

How it is used

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.

Why package nerds care

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.

Timeline

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

security posture

No protected-tool coverage found yet

No matching local secret-handling manifest was found for libpq. Nucleus package metadata is still published here so future coverage has a stable package URL.

Install behavior

  • No Homebrew post-install hook is recorded in formula metadata.
  • Homebrew bottle metadata is available for 6 platform targets.
  • Installs with 4 runtime dependencies.
  • Build metadata lists 3 build dependencies.

Recommended review

Before unattended agent use, check whether the tool reads plaintext credentials, writes remote state, publishes artifacts, or shells out to plugins.

local files

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

Config paths the tool may read or write during local use.

Unix
psqlrc in the directory reported by pg_config --sysconfdir~/.psqlrcpg_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

Credential-bearing paths to review before unattended agent runs.

Unix
~/.pgpass
Windows
%APPDATA%\postgresql\pgpass.conf

executables

Installed executables

CommandKindExposureNote
clusterdbcliglobal executable
createdbcliglobal executable
createusercliglobal executable
dropdbcliglobal executable
dropusercliglobal executable
ecpgcliglobal executable
initdbcliglobal executable
pg_amcheckcliglobal executable
pg_archivecleanupcliglobal executable
pg_basebackupcliglobal executable
pg_checksumscliglobal executable
pg_combinebackupcliglobal executable
pg_configcliglobal executable
pg_controldatacliglobal executable
pg_createsubscribercliglobal executable
pg_ctlcliglobal executable
pg_dumpcliglobal executable
pg_dumpallcliglobal executable
pg_isreadycliglobal executable
pg_receivewalcliglobal executable
pg_recvlogicalcliglobal executable
pg_resetwalcliglobal executable
pg_restorecliglobal executable
pg_rewindcliglobal executable
pg_test_fsynccliglobal executable
pg_test_timingcliglobal executable
pg_upgradecliglobal executable
pg_verifybackupcliglobal executable
pg_waldumpcliglobal executable
pg_walsummarycliglobal executable
pgbenchcliglobal executable
psqlcliglobal executable
reindexdbcliglobal executable
vacuumdbcliglobal executable

freshness

Version and freshness

These signals separate page generation age, package-manager activity, and upstream release comparison. Version lag is warned only when an evidence URL and comparable versions are present.

page generated2026-07-08
manager version18.4
manager updated2026-06-28
local dataok
upstreamnot checked
latest detectednot detected

https://www.postgresql.org/docs/current/libpq.html

install metadata

Package metadata

Package keybrew:libpq
Version18.4
Package managerHomebrew
Package manager pagehttps://formulae.brew.sh/formula/libpq
Homepagehttps://www.postgresql.org/docs/current/libpq.html
Repositoryhttps://git.postgresql.org/git/postgresql.git
Upstream docshttps://www.postgresql.org/docs/current/libpq.html
LicensePostgreSQL
Source archivehttps://ftp.postgresql.org/pub/source/v18.4/postgresql-18.4.tar.bz2
Last updated2026-06-28T05:00:52Z
Pulseupdated
Dependenciesicu4c@78, krb5, openssl@3, readline
Build dependenciesdocbook, docbook-xsl, pkgconf
Uses from macOScurl
Bottleavailable (on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux)
Homebrew post-installnot defined
Servicenone declared

registry facts

Source database details

Source DatabaseHomebrew formula API
Taphomebrew/core
Full Namelibpq
Aliases
  • libpq@18
Version Scheme0
Revision0
Bottle Stable Root URLhttps://ghcr.io/v2/homebrew/core
Deprecatedno
Disabledno
Keg Onlyyes
URL Keys
  • stable

source database matches

Other package-manager records

Matches are pulled from external package-manager indexes and kept separate from local Automic Vault package links.

apk95%

libpq 18.4-r0

PostgreSQL client library

https://www.postgresql.org/

sudo apk add libpq
  • License: PostgreSQL
  • Architecture: x86_64
  • Source Package: postgresql18
  • 1 dependencies
  • 1 provides
  • normalized package name match
  • Matched by: Libpq
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: libpq from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
dnf95%

libpq 18.4-1.fc45

PostgreSQL client library

http://www.postgresql.org/

sudo dnf install libpq
  • License: PostgreSQL
  • Category: Unspecified
  • Architecture: i686
  • Source Package: libpq
  • 6 dependencies
  • 3 provides
  • normalized package name match
  • Matched by: Libpq
Fedora Rawhide package metadata · dl.fedoraproject.org · Fedora Rawhide package metadata: libpq from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst
dnf95%

libpq-devel 18.4-1.fc45

Development files for building PostgreSQL client tools

http://www.postgresql.org/

sudo dnf install libpq-devel
  • License: PostgreSQL
  • Category: Unspecified
  • Architecture: i686
  • Source Package: libpq
  • 6 dependencies
  • 3 provides
  • normalized package name match
  • Matched by: Libpq
Fedora Rawhide package metadata · dl.fedoraproject.org · Fedora Rawhide package metadata: libpq-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst
Debian apt92%

pg-checksums-doc 1.2-2

Activate/deactivate/verify PostgreSQL data checksums (Documentation)

https://github.com/credativ/pg_checksums

sudo apt install pg-checksums-doc
  • Section: database
  • Architecture: all
  • Source Package: pg-checksums
  • installed executable or alias match
  • Matched by: Pg Checksums
Debian stable package indexes · deb.debian.org · Debian stable package indexes: pg-checksums-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz
Debian apt92%

postgresql-17-pg-checksums 1.2-2

Activate/deactivate/verify PostgreSQL data checksums

https://github.com/credativ/pg_checksums

sudo apt install postgresql-17-pg-checksums
  • Section: database
  • Architecture: amd64
  • Source Package: pg-checksums
  • 2 dependencies
  • 1 optional deps
  • installed executable or alias match
  • Matched by: Pg Checksums
Debian stable package indexes · deb.debian.org · Debian stable package indexes: postgresql-17-pg-checksums from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz
Nix92%

pg_checksums

nix profile install nixpkgs#pg_checksums
  • installed executable or alias match
  • Matched by: Pg Checksums
nixpkgs package indexes · api.github.com · 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 apt92%

pg-checksums-doc 1.1-6

Activate/deactivate/verify PostgreSQL data checksums (Documentation)

https://github.com/credativ/pg_checksums

sudo apt install pg-checksums-doc
  • Section: universe/doc
  • Architecture: all
  • Source Package: pg-checksums
  • installed executable or alias match
  • Matched by: Pg Checksums
Ubuntu 24.04 LTS package indexes · archive.ubuntu.com · Ubuntu 24.04 LTS package indexes: pg-checksums-doc from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz
Ubuntu apt92%

postgresql-16-pg-checksums 1.1-6

Activate/deactivate/verify PostgreSQL data checksums

https://github.com/credativ/pg_checksums

sudo apt install postgresql-16-pg-checksums
  • Section: universe/database
  • Architecture: amd64
  • Source Package: pg-checksums
  • 2 dependencies
  • 1 optional deps
  • installed executable or alias match
  • Matched by: Pg Checksums
Ubuntu 24.04 LTS package indexes · archive.ubuntu.com · Ubuntu 24.04 LTS package indexes: postgresql-16-pg-checksums from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz

source trail

Generated from repository data

This page is generated by av-web from the private package SQLite artifact built by scripts/generate-pkg-sqlite.py.

Used sources

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