在 ubuntu 16.04 中,当我想运行 pg_dump 时,它不起作用,我收到此错误语法错误。怎么了 ?
postgres=# pg_dump db_name > db_name1.sql
postgres-#
postgres-# ;
ERROR: syntax error at or near "pg_dump"
LINE 1: pg_dump db_name > db_name1.sql
^
postgres=#
pg_dump https://www.postgresql.org/docs/current/app-pgdump.html不是 SQL 命令。
它是一个独立的实用程序,因此您无法从 SQL 查询运行它。
请点击链接了解更多信息。
对于您的情况:输入\q<Enter>
从 SQL 客户端退出并使用 shell 提示符再次重复您的命令。
请记住您应该使用您的 SQL 凭据。
IE。:
$ pg_dump -U <postgres_user_name> db_name > db_name1.sql`
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)