Search Postgresql Archives

Request for feature: pg_dump schema masquerade flag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux