Re:

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Melvin Davidson <melvin6925(at)gmail(dot)com>, Alex Luya <alexander(dot)luya(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re:
Date: 2015-11-13 14:13:38
Message-ID: 5645F012.9000506@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/13/2015 05:19 AM, Melvin Davidson wrote:
> It is very simple. If you have already created database icare then
> DO NOT use the -create flag!

You can do that, you just cannot do that when the database you are
connecting to, --dbname=icare, is the one you want to create. I use
--dbname=postgres to connect to the system database postgres and have
pg_restore then clean/create the intended database from there. In this
case the database does not seem to be the issue. The problem is when
pg_restore starts trying to create SCHEMA in the database.

>
> http://www.postgresql.org/docs/9.2/interactive/app-pgrestore.html
>
> And as requested before, please provide the O/S and PostgreSQL version.
>
> On Fri, Nov 13, 2015 at 12:38 AM, Alex Luya <alexander(dot)luya(at)gmail(dot)com
> <mailto:alexander(dot)luya(at)gmail(dot)com>> wrote:
>
> Hello,
> I created a new database by
>
> create database icare;
>
> then quit off psql and run:
> pg_restore --clean --create --exit-on-error --dbname=icare
> icare-test.tar
>
> it complains:
>
> pg_restore: [archiver (db)] Error while PROCESSING TOC:
> pg_restore: [archiver (db)] Error from TOC entry 21; 2615
> 80924 SCHEMA icare icare
> pg_restore: [archiver (db)] could not execute query:
> ERROR: permission denied for database icare
> Command was: CREATE SCHEMA icare;
>
>
>
>
> --
> *Melvin Davidson*
> I reserve the right to fantasize. Whether or not you
> wish to share my fantasy is entirely up to you.

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

In response to

  • Re: at 2015-11-13 13:19:00 from Melvin Davidson

Browse pgsql-general by date

  From Date Subject
Next Message Giuseppe Sacco 2015-11-13 14:52:10 Re:
Previous Message Adrian Klaver 2015-11-13 14:05:00 Re: