Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PostgreSQL: command not found

I installed PostgreSQL via MacPorts. However, going to /opt/local/lib/postgresql84/bin I am unable to execute any of the pg commands. Does anyone know what I am doing wrong?

like image 478
Tian Avatar asked Aug 24 '10 23:08

Tian


Video Answer


1 Answers

When you say "going to", it sounds like you're using the cd command to change to that directory. Something like:

$ cd /opt/local/lib/postgresql84/bin
$ psql
psql: command not found

Normally on Unix systems, the current directory is not part of your executable search path. So either explicitly execute psql from the current directory using ./:

$ cd /opt/local/lib/postgresql84/bin
$ ./psql

or, add the directory to your PATH:

$ export PATH=/opt/local/lib/postgresql84/bin:$PATH
$ psql
like image 148
Greg Hewgill Avatar answered Jan 02 '23 06:01

Greg Hewgill