Re: BUG #5684: pg_restore does not restore schemas

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Nathan Gorter <nathan(at)vanbelle(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5684: pg_restore does not restore schemas
Date: 2010-10-04 21:54:28
Message-ID: AANLkTin_cmh5-s5QCfPXo3956u=cpjvwRqaJiupetUHL@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Sep 29, 2010 at 2:20 PM, Nathan Gorter <nathan(at)vanbelle(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Robert Haas 2010-10-04 23:33:46 Re: BUG #5690: pg_upgrade fails
Previous Message Robert Haas 2010-10-04 21:50:47 Re: Planner producing 100% duplicate subplans when unneeded