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

前端 未结 10 1327
面向向阳花
面向向阳花 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:23

    I had the same problem with nothing showing for the which psql command till I run the command below to resolve it. The command provided below is just a little tweak of what has already been provided by others here. The only difference is, instead of providing a specific postgres version number in the command, you can simply tell postgres to use the latest postgres version by simply running the following command:

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

    And now my terminal was able to find the path to postgres when I run which psql.

    Hope this helps.

提交回复
热议问题