Re: BUG #5684: pg_restore does not restore schemas - Mailing list pgsql-bugs

From Robert Haas
Subject Re: BUG #5684: pg_restore does not restore schemas
Date
Msg-id AANLkTin_cmh5-s5QCfPXo3956u=cpjvwRqaJiupetUHL@mail.gmail.com
Whole thread Raw
In response to BUG #5684: pg_restore does not restore schemas  ("Nathan Gorter" <nathan@vanbelle.com>)
List pgsql-bugs
On Wed, Sep 29, 2010 at 2:20 PM, Nathan Gorter <nathan@vanbelle.com> wrote:
> I am attempting to perform a dump from one database, create a new database,
> and restore the data to that new database. In my old database I have schemas
> besides the public schema that I have created myself. The pg_dump works fine
> and the pg_restore does not generate any errors, but the pg_restore fails to
> create the extra schemas, and instead restores the tables in those other
> schemas into the public schema. I have included my pg_dump and pg_restore
> commands below. I have tried the pg_restore command with and without the -c
> switch, and I have tried calling pg_restore twice, the first time using the
> -s switch and the second time using the -a switch. None of these have
> worked. On a note, when I manually create the extra schemas myself before
> performing the restore, it all works correctly.

When you use -t table, it only dumps those particular tables, and not
any schemas, functions, operators, or other database objects that
might be present in the target database.  This is by design, so it's
not a bug.  If you remove all the -t options, you'll get a dump of all
objects of all types in that database.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

pgsql-bugs by date:

Previous
From: Robert Haas
Date:
Subject: Re: Planner producing 100% duplicate subplans when unneeded
Next
From: Robert Haas
Date:
Subject: Re: BUG #5690: pg_upgrade fails