Re: Merging two database dumps

Поиск
Список
Период
Сортировка
От Alex O'Ree
Тема Re: Merging two database dumps
Дата
Msg-id CALLT8kiHONVhDJxu1_i-2xrqhELxJ2dzOx3MA_OHXD_kxne6Aw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Merging two database dumps  (Andreas Kretschmer <andreas@a-kretschmer.de>)
Ответы Re: Merging two database dumps  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
Desired behavior is to just log the error and continue the import using pgdump based copy commands 

The servers are not on the same network.  Sneaker net is the only way

On Wed, Jun 13, 2018, 7:42 AM Andreas Kretschmer <andreas@a-kretschmer.de> wrote:


Am 13.06.2018 um 13:17 schrieb Alex O'Ree:
> I have a situation with multiple postgres servers running all with the
> same databases and table structure. I need to periodically export the
> data from each of there then merge them all into a single server. On 
> occasion, it's feasible for the same record (primary key) to be stored
> in two or more servers

what should happen in this case?

>
> I was using pgdump without the --insert option however I just noticed
> that pgrestore will stop inserting into a table when the conflict
> occurs, leaving me with an incomplete set.
>

Other solution:

* create the tables on the destination server without the PK or with an
other, new PK (maybe SERIAL)
* use logical replication to replicate the table from all your
source-db's to the destination table, see more here:
https://www.2ndquadrant.com/en/resources/pglogical/

your problem seems as a typical task for logical replication to me. You
needs 9.4 at least.


Regards, Andreas

--
2ndQuadrant - The PostgreSQL Support Company.
www.2ndQuadrant.com


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

Предыдущее
От: Thomas Kellerer
Дата:
Сообщение: Re: First query on each connection is too slow
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: First query on each connection is too slow