libpq provides PostgreSQL client libraries and command-line tools without installing the full PostgreSQL server.
It is included for projects that need psql, pg_dump, client headers, or Composer packages that compile against PostgreSQL libraries.
The tool is installed through Homebrew and declared in the project Brewfile.
It is part of the curated Homebrew environment; see Homebrew setup to install everything at once.
Install libpq directly:
brew install libpqVerify the installation:
brew list --formula | grep -x libpq
brew --prefix libpqHomebrew installs libpq as keg-only. Use the full path when needed:
$(brew --prefix libpq)/bin/psql --version
$(brew --prefix libpq)/bin/pg_dump --versionAdd it to PATH only when a project or workflow really needs global PostgreSQL client commands.
Some native extensions may need explicit flags:
export LDFLAGS="-L$(brew --prefix libpq)/lib"
export CPPFLAGS="-I$(brew --prefix libpq)/include"Keep those exports project-local when possible.
Remove libpq with:
brew uninstall libpq