Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installed Postgres.app but it won't work

I just installed Postgres.app on my Mac but it won't work properly. I finished the installation and the app icon is on the menu bar and it says it is listening on port 5432, however, that is what happens if I try to run it from the command-line:

~ $ psql zsh: correct 'psql' to 'sl' [nyae]? n zsh: command not found: psql 

I had previously installed PostgreSQL via Homebrew but removed it before installing Postgres.app. I am running Mac OS X Lion.

I appreciate any help, I really want to have PostgreSQL running on my machine.

like image 798
rodrigoalvesvieira Avatar asked Aug 26 '12 23:08

rodrigoalvesvieira


People also ask

How do you check if postgres is installed?

Check Postgres Version from SQL Shell Type the following SQL statement within the prompt to check the current version: SELECT version(); The resulting output provides the full version and system information for the PostgreSQL server.

How do I start psql EXE?

open command prompt first ( Winkey+R ), then type C:\Program Files\PostgreSQL\10\bin\psql.exe , then press enter and type in password.


2 Answers

The psql binary for Postgres.app is inside the application bundle and you'll have to add the appropriate directory to your PATH. From the fine manual:

Configure your $PATH

Postgres.app includes many command line tools. If you want to use them, you must configure the $PATH variable.

If you are using bash (default shell on OS X), add the following line to ~/.bash_profile:

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

[...]

So adjust your PATH setting in your zsh config files to include the

Contents/Versions/latest/bin  

directory inside your Postgres.app bundle.

like image 142
mu is too short Avatar answered Sep 28 '22 01:09

mu is too short


I'm reading this as of April 2014 and the directory you must include in your path as far as my Postgres app is concerned is slightly different.

I had to include this:

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

I can now run psql in my terminal.

like image 32
jamesmarkcook Avatar answered Sep 28 '22 01:09

jamesmarkcook