像这样恢复转储时:
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
似乎模式“测试”还不存在,为什么会出现这种错误?