加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-13 16:25:58 所属栏目:百科 来源:网络整理
导读:在升级到小牛后,PostgreSQL开始播放,每当我调用pg_restore而不调用完整路径时,会发出此错误消息: pg_restore: command not found 如果我指定了完整的路径,它是有效的,但这显然不是最佳的: /Applications/Postgres93.app/Contents/MacOS/bin/pg_restore --v
在升级到小牛后,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"

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读