I installed PostgreSQL using the interactive installer by EnterpriseDB following this link. It defaulted the installation directory to /Library/PostgreSQL/9.6. After successful install, psql is not in the $PATH. I have to navigate to the installation directory or enter the full path execute it:
cd /Library/PostgreSQL/9.6/bin
./psql -d template1
Must I add this path to .profile or .bash_profile, create a symlink to /usr/bin? What approach is more suitable for the Mac?
Because this is not working:
# ln -s /Library/PostgreSQL/9.6/bin/psql /usr/bin/psql
ln: /usr/bin/psql: Operation not permitted
Temporary solution:
sh-3.2# ln -s postgres /usr/local/bin/postgres
sh-3.2# ln -s createdb /usr/local/bin/createdb
sh-3.2# ln -s createuser /usr/local/bin/createuser
sh-3.2# ln -s dropdb /usr/local/bin/dropdb
sh-3.2# ln -s dropuser /usr/local/bin/dropuser
sh-3.2# ln -s initdb /usr/local/bin/initdb
sh-3.2# ln -s pg_ctl /usr/local/bin/pg_ctl
sh-3.2# ln -s pg_dump /usr/local/bin/pg_dump
sh-3.2# ln -s pg_dumpall /usr/local/bin/pg_dumpall