in reply to Verifying 2 databases are in sync with brute force

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 :-)

    • Comment on Re: Verifying 2 databases are in sync with brute force