Skip to content

Instantly share code, notes, and snippets.

@itoonx
Forked from netsensei/libpq.md
Created March 11, 2025 00:56
Show Gist options
  • Save itoonx/1bdfe1977275262e3378ec4c05c3fbe3 to your computer and use it in GitHub Desktop.
Save itoonx/1bdfe1977275262e3378ec4c05c3fbe3 to your computer and use it in GitHub Desktop.
pqsl, pg_dump and pg_restore via hombrew

Installing pqsl, pg_dump and pg_restore via hombrew

These instructions allow you to intall psql, pg_dump & pg_restore without a full installation of postgresql.

First, install libpq via homebrew

brew doctor
brew update
brew install libpq

Since libpq is keg-only, you will need to manually add the bin directory to your $PATH variable

If you use zsh:

echo 'export PATH="/usr/local/opt/libpq/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

# or on M1 MacOS
echo 'export PATH="/opt/homebrew/opt/libpq/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

If you use bash:

echo 'export PATH="/usr/local/opt/libpq/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile

See als: SO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment