【发布时间】: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
模式“测试”似乎还不存在,为什么会出现这种错误?
【问题讨论】:
-
如果您不是超级用户,
schemata可能会隐藏架构。也缺少 postgres 版本。见postgresql.org/docs/current/static/infoschema-schemata.html
标签: postgresql database-schema pg-restore