Search code examples
bashmacospsql

Mac `zsh: command not found: psql`


I already added the path to the .bash_profile like this.

#psql
export "PATH=/Applications/Postgres.app/Contents/Versions/14/bin:$PATH"

And I successfully ran psql after I do source .bash_profile.

The problem is that when I closed the terminal and reopen it, psql doesn't work. I have to source .bash_profile again. How can I fix it?


Solution

  • That is because you are editing .bash_profile and using zsh as your shell.

    If you are to fix the problem, please edit .zshrc. Or alternatively, you can edit .zprofile and it will also work.