我遇到了一个问题,使用pg_restore进行数据库还原时无法正常工作。我在我的Mac上安装了Postgres 12.2,并运行High Sierra (10.13.6),它是通过Brew安装的。
我创建了一个简单的名为"foo"的数据库,其中包含一个名为"foo"的表,以测试此功能:
Nates-MacBook-Pro:k8s natereed$ psql -d foo
psql (12.2, server 12.1)
Type "help" for help.
foo=# SELECT table_schema,table_name
FROM information_schema.tables
WHERE table_schema='public' ORDER BY table_schema,table_name;
table_schema | table_name
--------------+------------
public | foo
(1 row)
生成转储文件:
pg_dump -Fc foo -f foo.backup
当我尝试还原时,没有任何反应。pg_restore只是卡住了:
pg_restore -h localhost -p 5432 -U postgres -v -Fc -f foo.backup
我尝试了这个命令的各种排列组合,但每次它都会停在那里。在活动监视器中,我可以看到这个进程,但它并没有使用任何CPU。
pg_restore -h localhost -p 5432 -U postgres -v -Fc foo.backup
。 - user330315