HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

After fresh install getting `psql: command not found`

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
afterinstallgettingpsqlfoundfreshcommandnot

Problem

I downloaded and installed PostgreSQL and PostGIS from KyngChaos for my OS X 10.10 install. When I run psql I get,

bash: psql: command not found


According to the site How to run psql on Mac OS X? it gets installed into /Library/PostgreSQL. There is no file there.

Solution

According to the README included in the dmg file, postgres binaries are installed in /usr/local/pgsql/bin/. You should add these lines in your ~/.bashrc :

export PSQL_DIR=/usr/local/pgsql/bin/
export PATH="$PSQL_DIR:$PATH"


Update your environment with source ~/.bashrc or run a new shell and psql should be available.

Code Snippets

export PSQL_DIR=/usr/local/pgsql/bin/
export PATH="$PSQL_DIR:$PATH"

Context

StackExchange Database Administrators Q#97619, answer score: 7

Revisions (0)

No revisions yet.