pg_dump issues

Started by Дмитрий Воронинover 8 years ago4 messages
#1Дмитрий Воронин
carriingfate92@yandex.ru

Hello,<div><br /></div><div>We are working on one project with postgres as engeneer.</div><div><br /></div><div>Bellow is list of inconveniences that we are having with postgresql. We would like to solve them as possible.<span style="background-color:rgb(66,133,244);color:rgb(255,255,255);font-family:Roboto,arial,sans-serif;font-size:20px;white-space:pre-wrap;"></span></div><div><br /></div><div>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.</div><div><br /></div><div>So, no one mechanisms to copy one schema to second one or to make aliases for any database object.</div><div><br /></div><div>How can we solve them?</div><div><br /></div><div>Thank you.</div><div><br /></div>

#2Craig Ringer
craig@2ndquadrant.com
In reply to: Дмитрий Воронин (#1)
Re: pg_dump issues

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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Victor Drobny
v.drobny@postgrespro.ru
In reply to: Дмитрий Воронин (#1)
Re: pg_dump issues

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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#4Дмитрий Воронин
carriingfate92@yandex.ru
In reply to: Victor Drobny (#3)
Re: pg_dump issues

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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers