PosgreSQLのパスの通しかた for Mac

顔妻です。
windowsではインストールしたには気にしなくても大丈夫ですが、Macでターミナル(ウインドウズのコマンドプロンプト)を使うためのpathの通し方のメモ書きです。

ターミナルに以下のコマンドを入力してみてください。

$ locate psql | grep /bin

WARNING: The locate database (/var/db/locate.database) does not exist.
To create the database, run the following command:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist
Please be aware that the database can take some time to generate; once
the database has been created, this message will no longer appear.

以下のエラーが出たかたは「sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist」を実行してください。

作成には時間がかかるので、5分ほどまってから以下を再度実行してみてください。

$ locate psql | grep /bin

/Library/PostgreSQL/11/debug_symbols/bin/psql.dSYM/Library/PostgreSQL/11/debug_symbols/bin/psql.dSYM/Contents/Library/PostgreSQL/11/debug_symbols/bin/psql.dSYM/Contents/Info.plist/Library/PostgreSQL/11/debug_symbols/bin/psql.dSYM/Contents/Resources/Library/PostgreSQL/11/debug_symbols/bin/psql.dSYM/Contents/Resources/DWARF/Library/PostgreSQL/11/debug_symbols/bin/psql.dSYM/Contents/Resources/DWARF/psql

上記がでてきたら次です。~/.bash_profile に以下のパスを追加してください。

PATH=$PATH:/Library/PostgreSQL/12/bin

保存が終わったら次はソースが反映されるように以下を実行して終わりです。お疲れ様でした。

source ~/.bash_profile

コメントを残す

メールアドレスが公開されることはありません。

CAPTCHA