libpq

Install command:
brew install libpq

Also known as: libpq@18

Postgres C API library

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

License: PostgreSQL

Development: Pull requests

Formula JSON API: /api/formula/libpq.json

Formula code: libpq.rb on GitHub

Bottle (binary package) installation support provided for:

macOS on
Apple Silicon
golden gate ✅
tahoe ✅
sequoia ✅
Linux ARM64 ✅
x86_64 ✅

Current versions:

stable ✅ 18.6

Other versions:

libpq@17 17.11 Postgres C API library
libpq@16 16.15 Postgres C API library

Revision: 2

Keg-only because it conflicts with PostgreSQL.

Depends on:

icu4c@79 79.1 C/C++ and Java libraries for Unicode and globalization
krb5 1.22.3 Network authentication protocol
openssl@4 4.1.0 Cryptography and SSL/TLS Toolkit
readline 8.3.6 Library for command-line editing

Depends on when building from source:

docbook 5.2.1 Standard XML representation system for technical documents
docbook-xsl 1.79.2 XML vocabulary to create presentation-neutral documents
pkgconf 3.0.10 Package compiler and linker metadata toolkit

Uses from macOS: bison (build), flex (build), libxml2 (build), libxslt (build), curl

Binaries: 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

GitHub Packages downloads:

Last 30 days476,740
Downloads23,112,222
Analytics install events (30 days)52,856
Downloads / install events (30 days)9.0×

Source: GitHub Packages, fetched 2026-11-11T00:50:10Z. Analytics dates: 2026-10-12 to 2026-11-11. Totals exclude downloads from Bintray before the migration to GitHub Packages. Downloads and install attempts measure different things; the difference does not count analytics opt-outs. Definitions and limitations.

Analytics:

30 days90 days365 days
Installs52,777123,243508,737
Installs (--HEAD)79156549
Installs on Request30,19669,685255,082
Installs on Request (--HEAD)74150529
Build Errors251