Member-only story

Get The Structure Difference Between Two Databases

Ramesh Ponnusamy
2 min readOct 27, 2021

While developing, we are doing database table changes frequently. when migrating an app from Development to UAT or Production there is a high chance to miss some changes from databases.

Nowadays, Mosts of web frameworks provide ORM functionality to overcome these problems.

But still, sometimes we are curious to see the database structure differences of the two databases.

Some DB tools like DBeaver gives options to see the DB structure differences across different databases with their own format. We might want to see the differences in a different format.

If can get the metadata of the database then can define our own format to see the differences.

For a Case, I have taken the Postgresql. Following queries are used to get basic metadata of tables.

DB Config:

Expected Output Format:

--

--

Ramesh Ponnusamy
Ramesh Ponnusamy

Written by Ramesh Ponnusamy

Data-Architect, SQL Master,Python ,Django, Flask dev, AI prompting, Linked-in: https://www.linkedin.com/in/ramesh-ponnusamy/ mail : ramramesh1374@gmail.com

No responses yet