Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2014

    Unanswered: Compare structure and data of two tables/DBs


    I have two postgresql databases on two different servers. Is there anyway I can compare the structure and data of these two databases and see whats the difference (in structure and data).

    Please help.


  2. #2
    Join Date
    Feb 2004
    In front of the computer
    Provided Answers: 54
    First you need to compare the structures of the databases. Depending on what tools you have, connectivity, etc. this comparison can range from trivial to difficult.

    The simplest solution is to export the whole contents of the INFORMATION_SCHEMA.COLUMNS to a text file. Be sure to specify the same ORDER and the same file format for both exports. The process for doing this varies greatly depending on your PostgreSQL version, the tools you have available, and even your hardware/software platform to some extent.

    After you understand the differences in the schema, you can decide how to compare the data. There are many ways to do this, and many choices that you will need to make after you understand the structure of your database. The actual comparison is pretty simple compared to determining what you need to compare and what comparison operations are valid for your data.

    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts