-bash:pg_dump:找不到命令

我正在尝试在本地为我的rails应用程序提取生产数据库。 我的本地postgres版本太低,所以我需要从9.4.1更新到Postgresql 9.6.5。

我通过Homebrew安装了Postgres 9.6.6:

brew install postgresql@9.6 

然后跑了:

 brew services start postgresql@9.6 

但是,当我尝试执行pg_dump我得到-bash: pg_dump: command not found

我也尝试更新我的路径:

 export PATH="/usr/local/Cellar/postgresql\@9.6/9.6.6/bin:$PATH" 

知道我需要做些什么来让pg_dump工作吗?

将此添加到我的〜/ .bash_profile就可以了:

export PATH=/usr/local/Cellar/postgresql\@9.6/9.6.6/bin:$PATH