A
A
Andrey2020-08-11 02:48:23
PostgreSQL
Andrey, 2020-08-11 02:48:23

Daily PostgreSQL DB sync?

Which tool is suitable for daily (once a day) PostgreSQL database synchronization? The databases are located on different servers of the same DC. Once a day, the contents of the database - about 10 million records - are completely replaced. After that, this update needs to be synchronized to another database. Physical replication is not suitable. Logical questionable, I think there should be better tools.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Melkij, 2020-08-11
@melkij

Once a day , the contents of the database - about 10 million records - are completely replaced .

pg_dump, pg_restore and do not pervert beyond what is necessary for the task.

A
Andrey Mokhov, 2015-03-18
@alexander_perov

something like this (I did not check the syntax, but I think the idea will be clear)

SELECT
    f.app_id as app1
    ,s.app_id as app2
    ,count(*) as cnt
FROM app_technologies f
INNER JOIN app_technologies s ON s.technology_id = f.technology_id AND s.app_id <> f.app_id
GROUP BY f.app_id, s.app_id
ORDER BY cnt DESC
LIMIT 1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question