snippetsqlCritical
How to run psql on Mac OS X?
Viewed 0 times
psqlmacrunhow
Problem
I installed PostgreSQL on a computer with Mac OS X using the One click installer. Then I try to access PostgreSQL using the
I get this message:
Do I have to install something more? Or how can I configure PostgreSQL so I can use it on my computer?
psql command, but it doesn't seem to be available.I get this message:
psql
-bash: psql: command not foundDo I have to install something more? Or how can I configure PostgreSQL so I can use it on my computer?
Solution
Appears "the way" to install the client, if you want to use hombrew, is:
(you need to specify the version after @) then
Apparently there's also a 'wrapper' to the
Another option is to install the
So follow the instructions it says after install out to add it to your PATH, or
brew install postgresql@15(you need to specify the version after @) then
psql (the client command line) will now be available to you (it also installs a local Postgres server/database, but you don't have to use that if all you want is the client).Apparently there's also a 'wrapper' to the
psql command to make it more "user friendly" also available via homebrew (brew install pgcli) in case interesting. Pgcli is a command line interface for Postgres with auto-completion and syntax highlighting.Another option is to install the
libpq homebrew package, but it doesn't get in your PATH.brew install libpqSo follow the instructions it says after install out to add it to your PATH, or
brew link --force libpq or add a symlink.Code Snippets
brew install postgresql@15brew install libpqContext
StackExchange Database Administrators Q#3005, answer score: 66
Revisions (0)
No revisions yet.