Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The local psql command could not be located

I'm following the instructions found here. When I try to run $ heroku pg:psql or $ heroku pg:psql HEROKU POSTGRESQL_BROWN I recieve the following error message:

! The local psql command could not be located ! For help installing psql, see local-postgresql

I can't find anything useful on the link it gives me (it just links to the instructions I was already using, but further down the page) nor can I find this error anywhere else.

If I've missed anything you need to know to answer this, just let me know. I'm rather new to all this and teaching myself as I go.

like image 727
TheMarron Avatar asked Mar 22 '13 17:03

TheMarron


People also ask

How do I connect to PostgreSQL localhost?

You can also connect to PostgreSQL database using pgAdmin GUI application. Connect to the database at localhost:5432 using the user name postgres and the password supplied. Now, double click on PostgreSQL 9.4 under the "Servers Groups". pgAdmin will ask you for a password.

Where can I find psql?

On Windows, you can find psql in the Program Files, and you should be able to launch it in a command prompt simply by clicking on it.

What is psql command?

psql is a terminal-based front-end to PostgreSQL. It enables you to type in queries interactively, issue them to PostgreSQL, and see the query results. Alternatively, input can be from a file or from command line arguments.


2 Answers

I had same error even after installing Postgres locally. But after seeing this I saw that "pqsl" was not in the PATH so I then did

PATH=%PATH%;C:\Program Files\PostgreSQL\9.2\bin

which worked for me

like image 77
Straff Avatar answered Sep 28 '22 02:09

Straff


I have since solved this myself. When I ran heroku pg:info it says the version number is 9.1.8, I was locally running 9.2

installing 9.1.8 and ensuring Path pointed to the appropriate folder solved the problem.

like image 6
TheMarron Avatar answered Sep 28 '22 02:09

TheMarron