pg_restore tells schema “test” already exists but it isn't actually

From: Alex Luya <alexander(dot)luya(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: pg_restore tells schema “test” already exists but it isn't actually
Date: 2015-11-13 02:53:55
Message-ID: CAL6j_s9vWko-oMRsmYzbOXF79U6WBZKPZPrUdn6cDBDoh__K=A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

When restoring a dump like this:

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

these error messages got printed out:

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;

but when:

select schema_name from information_schema.schemata;

these got printed out

schema_name --------------------
pg_toast
pg_temp_1
pg_toast_temp_1
pg_catalogpublic
information_schema

It seems like schema "test" doesn't exist yet,why do I got this kind of
error?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Melvin Davidson 2015-11-13 03:13:28 Re: [GENERAL] pg_restore tells schema “test” already exists but it isn't actually
Previous Message Tom Lane 2015-11-12 22:38:23 Re: Does PostgreSQL ever create indexes on its own?