【发布时间】:2018-07-22 15:18:15
【问题描述】:
所以我定期使用 pgadmin4 备份和恢复数据库和架构。我想使用 pg_dump 和 pg_restore 等命令来处理批处理文件。然而,我总是无法在这方面取得成功,并且可以使用一些帮助。我尝试转储一个模式(带有数据)的方式如下:
pg_dump -U postgres -F c -d database -n schema > mw2
然后我尝试使用 pg_restore 恢复它:
pg_restore -U postgres -d otherdatabase -n schema mw2
首先我尝试使用 .dump 代替 tar 但结果保持不变;这是我数据库中的一个空架构。
或以下错误信息:
pg_restore: [archiver] input file does not appear to be a valid archive
【问题讨论】:
标签: postgresql pg-dump pg-restore