PostgreSQL: command not found

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

+4
source share
5 answers

When you say “going,” it looks like you are using the command cdto modify this directory. Sort of:

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

Typically on Unix systems, the current directory is not included in your executable search path. Therefore, either explicitly execute psqlfrom the current directory with ./:

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

or, add the directory to your PATH:

$ export PATH=/opt/local/lib/postgresql84/bin:$PATH
$ psql
+17
source

Try "find / -name psql"

+4

Try

whereis psql
+3

postgres (Mac, The capitan SO) dmg, . psql brew. :

brew install postgres

.

+2
source

You can use the SQL Shell application (psql) if you installed dmg from the official site.

0
source

Source: https://habr.com/ru/post/1761415/


All Articles