I don't think this would be too hard to effect:

When pg_dumping a schema, have an additional flag -m <newschemaname>, that would convert all references in the dump from the original schema to the new schema name.

Thus the command:

pg_dump -c -s myoldschemaname -m mynewschemaname mydatabase -f foo

would generate a dump file such that all the data that was in myoldschemaname would, upon psql mydatabase < foo would be in a new (or replaced) schema mynewschemaname.

The present strategy is to go through the dump and manually change the schema names in the dump text. This is not a reliable mechanism, as there may be name collisions with the schema name and other names, and there's always the possibility that you might miss one when you're hand modifying the code.

I'd be happy to help on the effort if that makes sense. I don't know what the code to pg_dump is like, though.

-Owen

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

              http://www.postgresql.org/docs/faq

Reply via email to