🍺 BREW Explorer

← all formulae

libpq

brew install libpq v18.4 PostgreSQL keg-only

PostgreSQL C client library for building database applications and command-line tools.

Why you might care

Essential shared library if you're writing C/C++ applications that need to connect to PostgreSQL databases. Keg-only to avoid conflicts with the full PostgreSQL formula, but required by many database tools and clients. Provides connection pooling, prepared statements, and async query support.

Categories

Alternatives

PostgreSQL libpqxx
40.5k
30-day installs · #157
125.3k
90-day · #162
523.2k
365-day · #143

Runtime dependencies

Build dependencies

Links

Keg-only reason

it conflicts with PostgreSQL

Blurb generated by claude-haiku-4-5 on today.

Raw metadata
{
  "aliases": [
    "libpq@18"
  ],
  "alternatives": [
    "PostgreSQL",
    "libpqxx"
  ],
  "build_dependencies": [
    "docbook",
    "docbook-xsl",
    "pkgconf"
  ],
  "categories": [
    "library",
    "database-client"
  ],
  "caveats": null,
  "conflicts_with": [],
  "dependencies": [
    "icu4c@78",
    "krb5",
    "openssl@3"
  ],
  "deprecated": 0,
  "deprecation_reason": null,
  "desc": "Postgres C API library",
  "disable_reason": null,
  "disabled": 0,
  "enrichment_fetched_at": "2026-06-20T23:40:42+00:00",
  "first_seen": "2026-06-20T23:34:18+00:00",
  "full_name": "libpq",
  "github_default_branch": null,
  "github_last_commit_at": null,
  "github_readme_excerpt": null,
  "github_repo": null,
  "github_stars": null,
  "github_topics": [],
  "homepage": "https://www.postgresql.org/docs/current/libpq.html",
  "homepage_og_description": "Chapter\u0026nbsp;32.\u0026nbsp;libpq \u2014 C Library Table of Contents 32.1. Database Connection Control Functions 32.1.1. Connection Strings 32.1.2. Parameter Key Words 32.2. \u2026",
  "homepage_og_image": "https://www.postgresql.org/media/img/about/press/elephant.png",
  "homepage_title": "PostgreSQL: Documentation: 18: Chapter\u00a032.\u00a0libpq \u2014 C Library",
  "installs_30d": 40492,
  "installs_365d": 523155,
  "installs_90d": 125323,
  "keg_only": 1,
  "keg_only_reason": "it conflicts with PostgreSQL",
  "last_seen": "2026-06-20T23:34:18+00:00",
  "license": "PostgreSQL",
  "llm_generated_at": "2026-06-20T23:43:04+00:00",
  "llm_model": "claude-haiku-4-5",
  "name": "libpq",
  "oldnames": [],
  "one_liner": "PostgreSQL C client library for building database applications and command-line tools.",
  "optional_dependencies": [],
  "rank_30d": 157,
  "rank_365d": 143,
  "rank_90d": 162,
  "raw_hash": "0a2e0dd6988dfbb3",
  "recommended_dependencies": [],
  "revision": 0,
  "ruby_source_path": "Formula/lib/libpq.rb",
  "tap": "homebrew/core",
  "test_dependencies": [],
  "uses_from_macos": [
    {
      "bison": "build"
    },
    {
      "flex": "build"
    },
    {
      "libxml2": "build"
    },
    {
      "libxslt": "build"
    },
    "curl"
  ],
  "version_head": null,
  "version_stable": "18.4",
  "versioned_formulae": [
    "libpq@17",
    "libpq@16"
  ],
  "why_use_this": "Essential shared library if you\u0027re writing C/C++ applications that need to connect to PostgreSQL databases. Keg-only to avoid conflicts with the full PostgreSQL formula, but required by many database tools and clients. Provides connection pooling, prepared statements, and async query support."
}