-bash: pg_dump: 命令未找到

Tom*_*ond 5 postgresql homebrew ruby-on-rails

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

我通过 Homebrew 安装了 Postgres 9.6.6,如下所示:

brew install postgresql@9.6
Run Code Online (Sandbox Code Playgroud)

然后跑:

brew services start postgresql@9.6
Run Code Online (Sandbox Code Playgroud)

但是,当我尝试这样做时,pg_dump我得到了-bash: pg_dump: command not found.

我也尝试更新我的路径:

export PATH="/usr/local/Cellar/postgresql\@9.6/9.6.6/bin:$PATH"
Run Code Online (Sandbox Code Playgroud)

知道我需要做什么pg_dump才能上班吗?

Tom*_*ond 10

将其添加到我的 ~/.bash_profile 中就可以了:

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