简体   繁体   English

“pg_restore”处或附近的 Postgresql 错误语法错误

[英]Postgresql error syntax error at or near "pg_restore"

我在“pg_restore”处或附近收到语法错误:

pg_restore -i -h localhost -p 5432 -U postgres -d old_db -v 

From: https://www.reddit.com/r/PostgreSQL/comments/e6ezai/getting_a_syntax_error_when_trying_to_restore/来自: https : //www.reddit.com/r/PostgreSQL/comments/e6ezai/getting_a_syntax_error_when_trying_to_restore/

That means you are running pg_restore from within psql.这意味着您正在 psql 中运行 pg_restore。 But pg_restore is a command line program (not a SQL command) just like psql.exe (or createdb.exe or cmd.exe) so you need to run that on the command line, not within psql.但是 pg_restore 是一个命令行程序(不是 SQL 命令),就像 psql.exe(或 createdb.exe 或 cmd.exe)一样,所以你需要在命令行上运行它,而不是在 psql 中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM