Request for feature: pg_dump schema masquerade flag

From: Owen Hartnett <owen(at)clipboardinc(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Request for feature: pg_dump schema masquerade flag
Date: 2007-09-28 13:33:48
Message-ID: p06230905c322b0b1ce56@[192.168.0.109]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Henrik 2007-09-28 13:41:15 Preventing selection of data during transaction
Previous Message Alvaro Herrera 2007-09-28 13:16:23 Re: question about pg_dump -a