Re: pg_dump vs schemas

From: Francisco Reyes <lists(at)stringsutils(dot)com>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: Michael Glaesemann <grzm(at)seespotcode(dot)net>, PostgreSQL general <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_dump vs schemas
Date: 2007-07-16 18:58:41
Message-ID: cone.1184612321.418817.54070.5001@35st.simplicato.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jeff Davis writes:

> Let's say I have a development database, and I want to copy the entire
> schema myapp_dev1 to schema myapp_dev2 on the same database. Currently,
> it's fairly awkward to do that.

One possible way may be:
Dump the source schema.
Remove references to the schema name in the pg_dump file.
Change search_path and restore schema.

Not sure how this would work with the special Fc format. It should work with
the ASCII format.


> How do other people do that? Is it worth trying to add a way for
> pg_restore to rename object?

In the particular case that you mentioned, if pg_dump could be made to not
include the schema name anywhere that should make the process easier.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-07-16 19:06:07 Re: Moved postgres, now won't start
Previous Message Madison Kelly 2007-07-16 18:45:21 Re: Moved postgres, now won't start