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

From: Melvin Davidson <melvin6925(at)gmail(dot)com>
To: Alex Luya <alexander(dot)luya(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: [GENERAL] pg_restore tells schema “test” already exists but it isn't actually
Date: 2015-11-13 03:13:28
Message-ID: CANu8FizrG3JENSF6UT4wQNR7SyTbVYef8Fbf6or6QRe_14Go-w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Try this instead:
SELECT current_database();
SELECT nspname FROM pg_namespace ORDER BY 1;

Also, What is the exact command you are using with pg_restore?

On Thu, Nov 12, 2015 at 9:53 PM, Alex Luya <alexander(dot)luya(at)gmail(dot)com> 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 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?
>
>

--
*Melvin Davidson*
I reserve the right to fantasize. Whether or not you
wish to share my fantasy is entirely up to you.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Munro 2015-11-13 03:30:28 Re: Issues with german locale on CentOS 5,6,7
Previous Message Alex Luya 2015-11-13 02:53:55 pg_restore tells schema “test” already exists but it isn't actually