Good day all,

After I installed postgresql, adding an export PATH variable into the bash_profile and then restarting it caused all of my default PATH variables to not work anymore, including /usr/bin, /usr/sbin, and my homebrew paths. I removed it and everything worked again. Any way I can get this to work without breaking my PATH configuration?

This is what it looks like:

nano ~/.bash_profile

Added: export PATH="/Applications/Postgres.app/Contents/Versions/9.6/bin/psql"

Reloaded: source ~/.bash_profile

2 Answers 2


The difference between

PATH="/some/new/bin"         # wrong (in your case)


PATH="$PATH:/some/new/bin"   # correct (in your case)

is that the first replaces the value of the PATH variable while the second appends to the value of the same variable.

The line in your file should have read

export PATH="$PATH:/Applications/Postgres.app/Contents/Versions/9.6/bin"

Notice that $PATH should be a :-delimited list of directories. Names of individual binaries should not be listed here, only the names (paths) of directories where the shell should look for them.

You don't usually need to export the PATH since it's already exported.

If the value that you append to PATH is correct or not, I don't know.

export PATH="/my/path/bin:$PATH"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .