osx – 为什么我不能添加PostgreSQL到我的路径?

升级到小牛后,Postgresql开始播放,每当我调用pg_restore而不调用完整路径时,会发出此错误消息:
pg_restore: command not found

如果我指定了完整的路径,它是有效的,但这显然不是最佳的:

/Applications/Postgres93.app/Contents/MacOS/bin/pg_restore --verbose --clean --no-acl --no-owner -h localhost -U steven -d db/testivate_development $file_path

解决这个问题,我已经尝试删除所有版本的Postgresql(与Homebrew),然后安装Postgres.app.你可以确认这样做是这样的:

$sudo find / -name pg_restore
/Applications/Postgres93.app/Contents/MacOS/bin/pg_restore
find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory

要将Postgresql添加到我的路径,我尝试将以下每行添加到〜/ .bash_profile,〜/ bashrc和〜/ .zshrc中,每次尝试后重新启动:

export PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"

…根据postgresapp.com文档,然后…

export PATH="/Applications/Postgres93.app/Contents/MacOS/bin:$PATH"

…根据下面的评论.

这些都没有解决我的问题.

尝试将此行添加到.bash_profile中:
export PATH="/Applications/Postgres93.app/Contents/MacOS/bin:$PATH"

删除或注释掉以前的引用.

相关文章

项目需要,有个数据需要导入,拿到手一开始以为是mysql,结果...
本文小编为大家详细介绍“怎么查看PostgreSQL数据库中所有表...
错误现象问题原因这是在远程连接时pg_hba.conf文件没有配置正...
因本地资源有限,在公共测试环境搭建了PGsql环境,从数据库本...
wamp 环境 这个提示就是说你的版本低于10了。 先打印ph...
psycopg2.OperationalError: SSL SYSCALL error: EOF detect...