【发布时间】:2021-09-02 17:57:57
【问题描述】:
下面的结果显示了我遇到的问题。请让我知道我做错了什么。我正在尝试将 PostGreSQL 数据库迁移到另一台服务器。在第一台服务器上执行 pg_dump 并将 tar 文件转移到这个新服务器后,我在尝试将数据上传到新数据库时遇到了这个问题。
[postgres@host ~]$ psql newdb < newdb.tar
ERROR: syntax error at or near "toc" at character 1
LINE 1: toc.datREVOKE ALL ON SCHEMA public FROM postgres;
^
GRANT
GRANT
ERROR: syntax error at or near "" at character 1
LINE 1: id integer NOT NULL,
^
ERROR: syntax error at or near "" at character 1
LINE 1: REVOKE ALL ON TABLE auth_group FROM postgres;
^
ERROR: relation "auth_group" does not exist
ERROR: relation "auth_group" does not exist
ERROR: syntax error at or near "WITH" at character 7
LINE 1: START WITH 1
^
ERROR: syntax error at or near "" at character 1
LINE 1: id integer NOT NULL,
^
ERROR: syntax error at or near "" at character 1
LINE 1: REVOKE ALL ON TABLE auth_group_permissions FROM postgres;
^
ERROR: relation "auth_group_permissions" does not exist
ERROR: relation "auth_group_permissions" does not exist
ERROR: syntax error at or near "WITH" at character 7
LINE 1: START WITH 1
^
ERROR: syntax error at or near "" at character 1
LINE 1: id integer NOT NULL,
^
ERROR: syntax error at or near "" at character 1
LINE 1: REVOKE ALL ON TABLE auth_permission FROM postgres;
^
ERROR: relation "auth_permission" does not exist
ERROR: relation "auth_permission" does not exist
ERROR: syntax error at or near "WITH" at character 7
LINE 1: START WITH 1
^
ERROR: syntax error at or near "" at character 1
LINE 1: id integer NOT NULL,
^
ERROR: syntax error at or near "" at character 1
LINE 1: REVOKE ALL ON TABLE auth_user FROM postgres;
^
ERROR: relation "auth_user" does not exist
ERROR: relation "auth_user" does not exist
ERROR: syntax error at or near "id" at character 1
LINE 1: id integer NOT NULL,
^
ERROR: syntax error at or near "" at character 1
LINE 1: REVOKE ALL ON TABLE auth_user_groups FROM postgres;
^
ERROR: relation "auth_user_groups" does not exist
ERROR: syntax error at or near "WITH" at character 7
LINE 1: START WITH 1
^
ERROR: syntax error at or near "" at character 1
LINE 1: START WITH 1
^
ERROR: syntax error at or near "" at character 1
LINE 1: id integer NOT NULL,
^
ERROR: syntax error at or near "" at character 1
LINE 1: REVOKE ALL ON TABLE auth_user_user_permissions FROM postgr...
^
ERROR: relation "auth_user_user_permissions" does not exist
ERROR: syntax error at or near "WITH" at character 7
LINE 1: START WITH 1
^
ERROR: syntax error at or near "" at character 1
LINE 1: id integer NOT NULL,
^
ERROR: syntax error at or near "" at character 1
LINE 1: REVOKE ALL ON TABLE dashboard_account FROM postgres;
^
ERROR: relation "dashboard_account" does not exist
ERROR: relation "dashboard_account" does not exist
ERROR: syntax error at or near "WITH" at character 7
LINE 1: START WITH 1
^
ERROR: syntax error at or near "" at character 1
LINE 1: id integer NOT NULL,
^
ERROR: syntax error at or near "" at character 1
LINE 1: REVOKE ALL ON TABLE dashboard_account_organizations FROM p...
^
ERROR: relation "dashboard_account_organizations" does not exist
ERROR: syntax error at or near "WITH" at character 7
LINE 1: START WITH 1
^
ERROR: syntax error at or near "" at character 1
LINE 1: id integer NOT NULL,
^
ERROR: syntax error at or near "" at character 1
LINE 1: REVOKE ALL ON TABLE dashboard_budget FROM postgres;
^
ERROR: relation "dashboard_budget" does not exist
ERROR: syntax error at or near "id" at character 1
LINE 1: id integer NOT NULL,
^
ERROR: syntax error at or near "" at character 1
LINE 1: REVOKE ALL ON TABLE dashboard_budget_categories FROM postg...
^
ERROR: relation "dashboard_budget_categories" does not exist
ERROR: syntax error at or near "WITH" at character 7
LINE 1: START WITH 1
^
ERROR: syntax error at or near "" at character 1
LINE 1: id integer NOT NULL,
^
ERROR: syntax error at or near "" at character 1
LINE 1: REVOKE ALL ON TABLE dashboard_budget_comments FROM postgre...
^
ERROR: relation "dashboard_budget_comments" does not exist
ERROR: syntax error at or near "WITH" at character 7
LINE 1: START WITH 1
^
ERROR: syntax error at or near "" at character 1
LINE 1: START WITH 1
^
ERROR: syntax error at or near "" at character 1
LINE 1: id integer NOT NULL,
^
ERROR: syntax error at or near "" at character 1
LINE 1: REVOKE ALL ON TABLE dashboard_budget_restricted FROM postg...
^
ERROR: relation "dashboard_budget_restricted" does not exis
ERROR: syntax error at or near "WITH" at character 7
LINE 1: START WITH 1
^
ERROR: syntax error at or near "" at character 1
LINE 1: id integer NOT NULL,
^
ERROR: syntax error at or near "" at character 1
LINE 1: REVOKE ALL ON TABLE dashboard_category FROM postgres;
^
ERROR: relation "dashboard_category" does not exist
ERROR: relation "dashboard_category" does not exist
ERROR: syntax error at or near "WITH" at character 7
LINE 1: START WITH 1
^
ERROR: syntax error at or near "" at character 1
LINE 1: id integer NOT NULL,
^
invalid command \N
invalid command \N
invalid command \.
invalid command \.
invalid command \.
ERROR: syntax error at or near "" at character 1
LINE 1: 3 Account User
【问题讨论】:
-
这里有很多错误,我只是无法将它们全部放在这篇文章中。
标签: postgresql terminal syntax migration psql