【问题标题】:pg_restore tells schema "test" already exists but it isn't actuallypg_restore 告诉模式“测试”已经存在,但实际上并不存在
【发布时间】:2015-11-13 00:44:04
【问题描述】:

当像这样恢复转储时:

pg_restore --clean --create --exit-on-error --dbname=test test.tar

这些错误信息被打印出来了:

pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 21; 2615 80924 SCHEMA test test
pg_restore: [archiver (db)] could not execute query: ERROR:  schema "test" already exists
Command was: CREATE SCHEMA test;

但是当:

select schema_name from information_schema.schemata;

这些都打印出来了

schema_name     
--------------------
pg_toast
pg_temp_1
pg_toast_temp_1
pg_catalog
public
information_schema

模式“测试”似乎还不存在,为什么会出现这种错误?

【问题讨论】:

标签: postgresql database-schema pg-restore


【解决方案1】:

什么操作系统,哪个版本的 postgres 转储被恢复到相同的版本?

阅读this article,也许会有所帮助。

它指出--clean 参数存在一些小问题, 你可能应该尝试手动创建数据库并在没有 创建和清理选项。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-04-23
    • 1970-01-01
    • 2022-01-11
    • 1970-01-01
    • 2012-05-23
    • 1970-01-01
    • 2013-01-03
    相关资源
    最近更新 更多