Instalé Postgres.app pero no funcionará

Acabo de instalar Postgres.aplicación 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.

preguntado el 27 de agosto de 12 a las 00:08

7 Respuestas

Programas de psql binary for Postgres.app is inside the application bundle and you'll have to add the appropriate directory to your PATH. Desde fino manual:

Configure su $PATH

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

Si está utilizando golpear (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 

directorio dentro de tu Postgres.app haz.

Respondido 01 ago 16, 19:08

Hi, thanks, it worked. I'm having a different trouble now tho ERROR: invalid value for parameter "TimeZone": "utc" - rodrigoalvesvieira

@rodrigoalvesvieira Post a new question with more detail on that if you need to. - craig timbre

Note that for the current version of Postgres.app the correct path to is "/Applications/Postgres93.app/Contents/MacOS/bin" - NSTJ

As for today the location of the bin directory is: /Applications/Postgres.app/Contents/Versions/9.3/bin - Kummo

and today it's /Applications/Postgres.app/Contents/Versions/latest/bin - michele b

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.

Respondido 07 Abr '14, 10:04

This solution worked for me. The first with ..Contents/MacOS/bin No. - Aaron Lelevier

What you should do it use /latest instead of version so you dont need to change it again when updating Postgres.

Cómo estilizar tu guardarropa de premamá en el primer, segundo y tercer trimestre http://postgresapp.com/documentation/cli-tools.html

entonces corre:

. ~/.bash_profile

to reload .bash_profile and update any functions you add.

Respondido el 12 de enero de 16 a las 18:01

On zsh shell you have the modify .zshrc:

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

On prompt:

exec $SHELL
which psql

Respondido el 20 de diciembre de 18 a las 21:12

This might seem stupid, but I'm curious where you installed Postgres.app? As was suggested in mu is too short's answer, the documentation mentions adding /Applications/Postgres.app/Contents/MacOS/bin to your path. However, this requires that you have installed Postgres.app in your /Applications/ carpeta.

Before trying any of the more complicated solutions you might have found on Stack Overflow, and other resources via Google, you should make sure you've installed Postgres.app to the right place. It may be as simple as moving Postgres.app to /Applications/ desde psql se encontrará en /Applications/Postgres.app before any other places.

Alternatively, you could use whatever path to Postgres.app you would like. So if you want it in your home directory, then you could use export PATH="~/Postgres.app/Contents/MacOS/bin:$PATH".

HTH

respondido 27 nov., 12:03

BTW, this answer is more or less for anyone who stumbles across this question going forward, since I assume the original author has already resolved their problem after 3 months. - glevine

I'm a previous Ubuntu user, now in OSX Trying to run the "which sql" and "pg_restore" commands directly from a terminal I opened didn't work. I clicked on the elephant icon and opened a terminal by "Open psql". Once I've quit from the psql console and written the commands in that terminal, they all worked.

respondido 01 nov., 14:11

On ZSH terminal, before trying the above solutions you have to install Postgres in the first place. While using Hombrew First, hit,

brew install postgres Then check if it is installed by which psql

Respondido el 15 de Septiembre de 19 a las 11:09

Postgress.app recommends removing any postgres installations that were installed via brew. This way there's no conflicting servers or services running, but then you lose out on the cli tooling. To be honest though I'm installing it back via brew so I can quickly access my tooling, but realize that I need to: Make sure the versions match up, make sure to determine which postgres I would like to be running as a service (brew's or postgressapp's). - CTS_AE

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.