Re: "Pg_restore -C" is not creating a database ( Was Create database bug in 8.1.3 ? ) - Mailing list pgsql-general

From Tom Lane
Subject Re: "Pg_restore -C" is not creating a database ( Was Create database bug in 8.1.3 ? )
Date
Msg-id 9095.1144598488@sss.pgh.pa.us
Whole thread Raw
In response to "Pg_restore -C" is not creating a database ( Was Create database bug in 8.1.3 ? )  ("Milen Kulev" <makulev@gmx.net>)
Responses Re: "Pg_restore -C" is not creating a database ( Was Create database bug in 8.1.3 ? )  ("Milen Kulev" <makulev@gmx.net>)
List pgsql-general
"Milen Kulev" <makulev@gmx.net> writes:
> My case : I have a DB, that I  have archived with
> pg_dump -C -Fc  -d   testdb1 > tdb1b.bak
> Then I am dropping the database testdb1 ( with DROP DATABASE testdb1; ) I want to recover it. When I issue the
following
> command:
> pg_restore  -C -Fc tdb1b.bak
> I am getting all the SQL statements executed, but the DB testdb1 is NOT created, although
> I have explicitely specified it (-C option).

Works AFAICS --- I see this in pg_restore's output:

    CREATE DATABASE testdb1 WITH TEMPLATE = template0 ENCODING = 'UTF8';

    ALTER DATABASE testdb1 OWNER TO postgres;

    \connect testdb1

Are you not getting those commands?  Maybe they are failing for some
reason?

            regards, tom lane

pgsql-general by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Load testing across 2 machines
Next
From: Tom Lane
Date:
Subject: Re: index growth