Hello
We have a custom app running at two locations, where DB is at Location A and
location B connects to it via a VPN. Our internet went down (long story) at
location A. As a temporary solution I install the DB at Location B, so now
location A and B are on different DB. After about four weeks internet is
back online. How can I synch and compare the two databases and make them the
same, so I can go back to the original setup. (I need a tool that can
compare the two db and add all the entries that are in B, but not in A to A)

Rudy

Search Discussions

  • Frank Bax at Oct 18, 2009 at 12:43 pm

    roody senecal wrote:
    Hello
    We have a custom app running at two locations, where DB is at Location A
    and location B connects to it via a VPN. Our internet went down (long
    story) at location A. As a temporary solution I install the DB at
    Location B, so now location A and B are on different DB. After about
    four weeks internet is back online. How can I synch and compare the two
    databases and make them the same, so I can go back to the original
    setup. (I need a tool that can compare the two db and add all the
    entries that are in B, but not in A to A)

    pg_dump DatabaseA > BackupA
    pg_dump DatabaseB > BackupB
    diff BackupA BackupB > Changes

    If conditions are exactly as you think they are; then "Changes" should
    only contain INSERT statements which are in BackupB, but not in BackupA.
    Use psql to execute the INSERT statements.

    If "Changes" file indicates that some rows were changed instead of
    inserted; then you can still contruct an approriate "UPDATE" from the
    output of diff.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-novice @
categoriespostgresql
postedOct 12, '09 at 5:52a
activeOct 18, '09 at 12:43p
posts2
users2
websitepostgresql.org
irc#postgresql

2 users in discussion

Frank Bax: 1 post Roody senecal: 1 post

People

Translate

site design / logo © 2022 Grokbase