【问题标题】:Postgres.app: pg_restore hangsPostgres.app:pg_restore 挂起
【发布时间】:2013-06-24 03:11:41
【问题描述】:

我正在尝试对系统上的pg_restore 命令进行故障排除。我已经安装了Postgresapp,我已经安装了included its binaries on my PATHpsqlpg_dump 之类的命令似乎可以正常工作,而运行 which pg_restore 会得到预期的结果。

$ which pg_restore
/Applications/Postgres.app/Contents/MacOS/bin/pg_restore

问题是pg_restore 似乎没有做任何事情。当我在终端中运行它时,不会输出任何输出,无论是输出到控制台还是输出到logs。无论我传入什么参数,包括--verbose 开关,这都是正确的。运行它确实会导致 pg_restore 进程出现在我的活动监视器中,但该进程不使用任何 CPU。除此之外,什么都没有发生。

有其他人看到这个问题吗?您对让pg_restore 工作有什么建议吗?

【问题讨论】:

  • 您要恢复多少数据?通常 pg_restore 在完成之前不会输出任何内容,除非出现错误或警告,除非您指定 --verbose 模式。

标签: macos postgresql osx-mountain-lion heroku-postgres


【解决方案1】:

我想我明白了。

我正在运行的命令在用户名之后包含一个额外的换行符。

就像,我试图执行这个

pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myusername
-d mydb latest.dump

而不是这个

pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myusername -d mydb latest.dump

由于某种原因,额外的换行符使事情变得混乱。一旦我删除它,pg_restore 就可以正常工作了。

【讨论】:

    【解决方案2】:

    我也无缘无故被卡住了。我从 pg_restore -U seed -h localhost -p 5432 -f dump.backup -C --verbose 更改为 pg_restore -d seed -U seed -h localhost -p 5432 < dump.backup 并且成功了。

    如果这可以帮助某人..

    【讨论】:

      猜你喜欢
      • 2012-12-20
      • 1970-01-01
      • 2016-01-16
      • 2015-07-06
      • 2011-03-07
      • 2012-06-22
      • 2018-06-14
      • 2012-12-29
      • 2015-02-18
      相关资源
      最近更新 更多