Moving several databases into one database with several schemas

Поиск
Список
Период
Сортировка
От Edson Richter
Тема Moving several databases into one database with several schemas
Дата
Msg-id BLU0-SMTP4476673BF2DD21000169FCCCFA90@phx.gbl
обсуждение исходный текст
Ответы Re: Moving several databases into one database with several schemas  (Edson Richter <edsonrichter@hotmail.com>)
Список pgsql-general
Dear list,

Scenario:

I'm using PostgreSQL 9.1 on Linux x64 running over CentOS 5. Everything is fine, but now I do have 4 separate databases running on different servers, and every server has some shared tables.

I've been working on a complex logic that is able to "replicate" these tables in a way that is almost impossible to use existing solutions (I've to merge records when replicating). My conclusion is that the logic is just too complex to maintain, and I would like to consolidate databases but keep data separate. Few days ago, I've posted this query in this list, and got the orientation to try using schemas.

That's what I want to do know: I would like to consolidate these 4 separate databases in 1 database with 5 schemas:

- Main schema: will have all shared tables, that will be read only most of time;
- Schema1 to Schema4: will have their own tables, read write.

Now the questions:

1) Is there a way to "backup" database1 and "restore" in the consolidated database, but in "schema1" (not overwriting everything)?
2) Is there a way to specify the default schema in JDBC url (or command I can issue to change the default schema at runtime, like "set path...")?

Thanks in advance,

Edson Richter


В списке pgsql-general по дате отправления:

Предыдущее
От: "Sahagian, David"
Дата:
Сообщение: Re: values from txid_current()
Следующее
От: Aleksey Tsalolikhin
Дата:
Сообщение: Re: postgres process got stuck in "notify interrupt waiting" status