I am using a mac and when i use psql in terminal i got zsh: command not found: psql
I searched and saw that i should set up the PATH export PATH=${POSTGRES_HOME}/bin:${PATH}
so my question where i do this ? and what are the variables between { }.
Question posted in PostgreSQL
The official documentation can be found here.
The official documentation can be found here.
2
Answers
I missed this :
sudo mkdir -p /etc/paths.d && echo /Applications/Postgres.app/Contents/Versions/latest/bin | sudo tee /etc/paths.d/postgresapp
In the end, it’s your decision where to do it. I suggest that you read first the section "STARTUP/SHUTDOWN FILES" in the zsh man page to see what files are processed by zsh on start and on this choose the one which is best for you.
For instance, If you want the setting it for every zsh (interactive and non-interactive, login and non-login) shells, your ~/.zshenv would be the place to go. If you want it for any interactive shell only, put it into ~/.zshrc.
In any case, I suggest that you add the command
This avoids that the same directory will be added again and again by each zsh child process.
Finally, you may find it more convenient to use
path
instead ofPATH
:Since the scalar
PATH
is tied to the arraypath
, you can use either one.