How to put psql on the path when using Postgres.app on OS X?

前端 未结 10 1113
面向向阳花
面向向阳花 2021-02-05 05:01

I\'ve installed Postgres93 on my Mac. I can open the application, and \"Open psql\" through the app which opens up a command line interface with psql.

However, when I ty

10条回答
  •  被撕碎了的回忆
    2021-02-05 05:27

    On macOS Mojave these instructions work well:

    1. If your Postgres has not been installed yet, I suggest you use the great "brew" package manager from here https://brew.sh/ :

      $ brew cask install postgres or you can install it usual way from the website

    2. Put this to the bottom of your ~/.bash_profile file:

      export PATH="/Applications/Postgres.app/Contents/Versions/latest/bin:${PATH}"

    3. Restart your terminal or restart your ~/.bash_profile directly with the command:

      $ . ~/.bash_profile

    4. Verify your installation:

      $ psql --version

提交回复
热议问题