Обсуждение: [HACKERS] pg_dump issues
Hello,
We are working on one project with postgres as engeneer.
Bellow is list of inconveniences that we are having with postgresql. We would like to solve them as possible.
We can't create any schema dump with another (user defined) name. E.g. we dump schema test and we want to save it's dump with test2 name in any format. Those refers to databases dump.
So, no one mechanisms to copy one schema to second one or to make aliases for any database object.
How can we solve them?
Thank you.
On 6 June 2017 at 11:37, Дмитрий Воронин <carriingfate92@yandex.ru> wrote: > Hello, > > We are working on one project with postgres as engeneer. > > Bellow is list of inconveniences that we are having with postgresql. We > would like to solve them as possible. > > We can't create any schema dump with another (user defined) name. E.g. we > dump schema test and we want to save it's dump with test2 name in any > format. Those refers to databases dump. This is a pretty common request. I expect a patch to add a --transform or --rename option to pg_dump (or maybe pg_restore) might be accepted. I suggest posting a detailed design for how you plan to do it and asking for feedback before proceeding to implement it. You should search the mailing list for past discussions and ideas too. Otherwise, consulting outfits can do this sort of thing for you; see https://www.postgresql.org/support/professional_support/ . (Note, I work for one of them). -- Craig Ringer http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services
> We can't create any schema dump with another (user defined) name. E.g. > we dump schema test and we want to save it's dump with test2 name in > any format. Those refers to databases dump. Hello, Do you expect to have some flag like '--rename=test->test2'? Will dump with test replaced by test2(of course only in related places) be valid dump in this case? What is the possible scenario for the renaming option? Is it doing to be dumping of the one schema only? Or it could be dump of database? In this case pg_dump should also support multiple rules for renaming. Thank you for attention! -- ------ Victor Drobny Postgres Professional: http://www.postgrespro.com The Russian Postgres Company
Hello, 25.07.2017, 11:17, "Victor Drobny" <v.drobny@postgrespro.ru>: > > Hello, > > Do you expect to have some flag like '--rename=test->test2'? Yes, I do. > Will dump with test replaced by test2(of course only in related places) > be valid dump in this case? Yes, it will. > What is the possible scenario for the renaming option? Is it doing to be > dumping of the one schema only? > Or it could be dump of database? In this case pg_dump should also > support multiple rules for renaming. pg_dump scans dumped objects and rename them by rules, that could be set by pg_dump argument line options. As I now, pg_dump and pg_restore use the same functions, so, renaming mechanism can be integrated in pg_restore too. pg_restore will scan dumped objects and rename them by rules. In future, rules could be applied on all database objects. > > Thank you for attention! > > -- > ------ > Victor Drobny > Postgres Professional: http://www.postgrespro.com > The Russian Postgres Company -- Best regards, Dmitry Voronin