PostgreSQL: database restore from dump - syntax error

喜夏-厌秋 提交于 2019-12-02 15:51:54
John Paulett

The -f filename argument on psql will read in the file, so you don't have to pipe it in. psql should be included in PostgreSQL's bin directory in windows. Like so:

psql -d dbname -U username -f dumpfile.sql

You may have to include a full path to the psql executable if it is not on your path, and possible add ".exe" to psql, so it is "psql.exe".

Also make sure you are not going down in version numbers, I've run into syntax issues before (e.g don't export an 8.4 database and try to load it into an 8.1 database). If so, you may have to manually edit the dump file.

try with psql -d dbname -U user -f dumpfile.sql

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