Depends if you have control over the data.

Add a "last update" timestamp column to each table (maybe using a server-side-trigger). Next use a perl script to compare each row which has been written since the last check (time):

  • Grab the last-check-timestamp from a DB or file
  • Put the current timestamp into a variable
  • select and verify all changed and new rows
  • Flush the timestamp gathered in step 2 to DB or file
  • You'll get all updated rows and rows which have been deleted on one but not on the other server.

    You might be able to do a SELECT JOIN if the two servers are connected and limit the output to the differing rows, but this is too much for my Postgres knowledge :-)


    In reply to Re: Verifying 2 databases are in sync with brute force by Sewi
    in thread Verifying 2 databases are in sync with brute force by dwhite20899

    Title:
    Use:  <p> text here (a paragraph) </p>
    and:  <code> code here </code>
    to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.