Using pg_dump and pg_restore correctly

偶尔善良 提交于 2019-12-01 23:25:10

https://www.postgresql.org/docs/current/static/app-pgrestore.html

--format=format Specify format of the archive. It is not necessary to specify the format, since pg_restore will determine the format automatically. If specified, it can be one of the following:

custom, directory and tar

https://www.postgresql.org/docs/current/static/app-pgdump.html

--format=format

Selects the format of the output. format can be one of the following:

p plain Output a plain-text SQL script file (the default).

others are custom, directory and tar

in short - you used defualt plain format, which is meant for using with psql, not pg_restore. So either specify different format with pg_dump or use your file as

psql -f  mw2.tar
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!