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.