0
當恢復這樣的轉儲:pg_restore在告訴模式「測試」已存在,但它實際上不是
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版本丟失。請參閱http://www.postgresql.org/docs/current/static/infoschema-schemata.html –