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

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_restore tells schema “test” already exists but it isn't actually
Date: 2015-11-13 05:10:49
Message-ID: 564570D9.8080009@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/12/2015 06:53 PM, Alex Luya wrote:
> 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 whilePROCESSING TOC:pg_restore:[archiver
> (db)]Error fromTOC entry 21;261580924SCHEMAtest test
> pg_restore:[archiver (db)]could
> notexecutequery:ERROR:schema"test"already existsCommand
> was:CREATESCHEMAtest;|
>
> but when:
>
> |selectschema_name frominformation_schema.schemata;|
>
> these got printed out
>
> |schema_name --------------------pg_toast pg_temp_1 pg_toast_temp_1
> pg_catalog publicinformation_schema|

What database are you running the above on?

What is the database you are trying to CREATE and does it already exist
when you run the restore?

What happens if you try without --exit-on-error?

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

>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alex Luya 2015-11-13 05:38:19
Previous Message Thomas Munro 2015-11-13 03:30:28 Re: Issues with german locale on CentOS 5,6,7