无法还原Postgres数据库转储
我使用了以下命令
sudo psql my_database_name < feb9.sql
SET
SET
SET
SET
SET
CREATE EXTENSION
COMMENT
SET
SET
SET
ERROR: relation "admin_tools_dashboard_preferences" already exists
ALTER TABLE
ERROR: relation "admin_tools_dashboard_preferences_id_seq" already exists
ALTER TABLE
ALTER SEQUENCE
ERROR: relation "admin_tools_menu_bookmark" already exists
ALTER TABLE
ERROR: relation "admin_tools_menu_bookmark_id_seq" already exists
ALTER TABLE
ALTER SEQUENCE
ERROR: relation "auth_group" already exists
ALTER TABLE
ERROR: relation "auth_group_id_seq" already exists
ERROR: duplicate key value violates unique constraint "product_rateclass_code_uniq"
DETAIL: Key (code)=(0) already exists.
CONTEXT: COPY product_rateclass, line 1: "40787 0 Tariff Rates"
setval
--------
40791
(1 row)
ERROR: relation "admin_tools_menu_bookmark_user_id" already exists
ERROR: relation "auth_group_name_like" already exists
ERROR: relation "auth_group_permissions_group_id" already exists
ERROR: relation "auth_group_permissions_permission_id" already exists
ERROR: relation "auth_permission_content_type_id" already exists
ERROR: relation "auth_user_groups_group_id" already exists
ERROR: relation "auth_user_groups_user_id" already exists
ERROR: relation "auth_user_user_permissions_permission_id" already exists
ERROR: relation "auth_user_user_permissions_user_id" already exists
ERROR: relation "auth_user_username_like" already exists
REVOKE
REVOKE
GRANT
GRANT
我收到了以上错误日志(我的此类日志运行了数百行,我使用了几行作为参考)。
执行该命令后,数据库仍包含旧记录,而不是新记录。
我删除了现有数据库并创建了新数据库。
$dropdb development_db_name
$ createdb developmnent_db_name
然后我使用还原了数据库
sudo psql my_database_name < feb9.sql
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句