Skip to content

Instantly share code, notes, and snippets.

@netsensei
Created March 20, 2024 12:33
Show Gist options
  • Save netsensei/67b74cb136d9b1e442eb980ff07a50fe to your computer and use it in GitHub Desktop.
Save netsensei/67b74cb136d9b1e442eb980ff07a50fe 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